mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
28 lines
444 B
PHP
28 lines
444 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()
|
|
{
|
|
return config('routes.hashtag.base') . $this->slug;
|
|
}
|
|
|
|
}
|