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

37 lines
813 B
PHTML

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class UserFilter extends Model
{
protected $guarded = [];
public function mutedUserIds($profile_id)
{
9 months ago
return $this->whereUserId($profile_id)
->whereFilterableType(Profile::class)
9 months ago
->whereFilterType('mute')
->pluck('filterable_id');
}
public function blockedUserIds($profile_id)
{
9 months ago
return $this->whereUserId($profile_id)
->whereFilterableType(Profile::class)
9 months ago
->whereFilterType('block')
->pluck('filterable_id');
}
public function instance()
{
return $this->belongsTo(Instance::class, 'filterable_id');
}
public function user()
{
return $this->belongsTo(Profile::class, 'user_id');
}
}