mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
447 B
PHTML
29 lines
447 B
PHTML
7 years ago
|
<?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;
|
||
|
}
|
||
|
|
||
|
}
|