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.
pixelfed/app/Models/Hashtag.php

29 lines
573 B
PHTML

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