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
PHTML
37 lines
813 B
PHTML
|
8 years ago
|
<?php
|
||
|
|
|
||
|
4 weeks ago
|
namespace App\Models;
|
||
|
8 years ago
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class UserFilter extends Model
|
||
|
|
{
|
||
|
4 weeks ago
|
protected $guarded = [];
|
||
|
8 years ago
|
|
||
|
|
public function mutedUserIds($profile_id)
|
||
|
|
{
|
||
|
9 months ago
|
return $this->whereUserId($profile_id)
|
||
|
4 weeks ago
|
->whereFilterableType(Profile::class)
|
||
|
9 months ago
|
->whereFilterType('mute')
|
||
|
|
->pluck('filterable_id');
|
||
|
8 years ago
|
}
|
||
|
|
|
||
|
|
public function blockedUserIds($profile_id)
|
||
|
|
{
|
||
|
9 months ago
|
return $this->whereUserId($profile_id)
|
||
|
4 weeks ago
|
->whereFilterableType(Profile::class)
|
||
|
9 months ago
|
->whereFilterType('block')
|
||
|
|
->pluck('filterable_id');
|
||
|
8 years ago
|
}
|
||
|
8 years ago
|
|
||
|
|
public function instance()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Instance::class, 'filterable_id');
|
||
|
|
}
|
||
|
3 years ago
|
|
||
|
|
public function user()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Profile::class, 'user_id');
|
||
|
|
}
|
||
|
8 years ago
|
}
|