1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-27 10:16:47 +00:00
pixelfed/app/Hashtag.php

28 lines
465 B
PHP
Raw Normal View History

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Hashtag extends Model
{
2018-08-28 03:07:36 +00:00
public $fillable = ['name', 'slug'];
public function posts()
{
2018-08-28 03:07:36 +00:00
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;
}
}