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/StatusHashtag.php

49 lines
1015 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
/**
* @property-read int $count aggregate/computed alias
* @property-read int $total aggregate/computed alias
*/
class StatusHashtag extends Model
{
public $fillable = [
'status_id',
'hashtag_id',
'profile_id',
'status_visibility',
];
public function status(): BelongsTo
{
return $this->belongsTo(Status::class);
}
public function hashtag(): BelongsTo
{
return $this->belongsTo(Hashtag::class);
}
public function profile(): BelongsTo
{
return $this->belongsTo(Profile::class);
}
public function media(): HasManyThrough
{
return $this->hasManyThrough(
Media::class,
Status::class,
'id',
'status_id',
'status_id',
'id'
);
}
}