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.
37 lines
813 B
PHP
37 lines
813 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UserFilter extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
public function mutedUserIds($profile_id)
|
|
{
|
|
return $this->whereUserId($profile_id)
|
|
->whereFilterableType(Profile::class)
|
|
->whereFilterType('mute')
|
|
->pluck('filterable_id');
|
|
}
|
|
|
|
public function blockedUserIds($profile_id)
|
|
{
|
|
return $this->whereUserId($profile_id)
|
|
->whereFilterableType(Profile::class)
|
|
->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');
|
|
}
|
|
}
|