1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-30 19:55:10 +00:00
pixelfed/app/Hashtag.php
2019-07-10 21:26:05 -06:00

27 lines
465 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Hashtag extends Model
{
public $fillable = ['name', 'slug'];
public function posts()
{
return $this->hasManyThrough(
Status::class,
StatusHashtag::class,
'hashtag_id',
'id',
'id',
'status_id'
);
}
public function url($suffix = '')
{
return config('routes.hashtag.base').$this->slug.$suffix;
}
}