mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-14 18:44:31 +00:00
34 lines
620 B
PHP
34 lines
620 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Services\AccountService;
|
|
use App\Profile;
|
|
|
|
class AdminShadowFilter extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $casts = [
|
|
'created_at' => 'datetime'
|
|
];
|
|
|
|
public function account()
|
|
{
|
|
if($this->item_type === 'App\Profile') {
|
|
return AccountService::get($this->item_id, true);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
public function profile()
|
|
{
|
|
return $this->belongsTo(Profile::class, 'item_id');
|
|
}
|
|
}
|