pixelfed/app/Models/AdminShadowFilter.php

34 lines
620 B
PHP
Raw Normal View History

2023-09-15 04:23:46 +00:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Services\AccountService;
use App\Profile;
2023-09-15 04:23:46 +00:00
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');
}
2023-09-15 04:23:46 +00:00
}