mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
29 lines
447 B
PHP
29 lines
447 B
PHP
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class Hashtag extends Model
|
||
|
{
|
||
|
protected $fillable = ['name','slug'];
|
||
|
|
||
|
public function posts()
|
||
|
{
|
||
|
return $this->hasManyThrough(
|
||
|
Status::class,
|
||
|
StatusHashtag::class,
|
||
|
'hashtag_id',
|
||
|
'id',
|
||
|
'id',
|
||
|
'status_id'
|
||
|
);
|
||
|
}
|
||
|
|
||
|
public function url()
|
||
|
{
|
||
|
return config('routes.hashtag.base') . $this->slug;
|
||
|
}
|
||
|
|
||
|
}
|