Files
newznab-tmux/app/Models/GdprAuditLog.php
T
2026-06-17 09:49:39 +02:00

61 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class GdprAuditLog extends Model
{
const UPDATED_AT = null;
/**
* @var list<string>
*/
protected $fillable = [
'gdpr_request_id',
'user_id',
'actor_id',
'event',
'description',
'metadata',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'metadata' => 'array',
'created_at' => 'datetime',
];
}
/**
* @return BelongsTo<GdprRequest, $this>
*/
public function gdprRequest(): BelongsTo
{
return $this->belongsTo(GdprRequest::class);
}
/**
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class)->withTrashed();
}
/**
* @return BelongsTo<User, $this>
*/
public function actor(): BelongsTo
{
return $this->belongsTo(User::class, 'actor_id')->withTrashed();
}
}