42 lines
904 B
PHP
42 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int|null $user_id
|
|
* @property string $action
|
|
* @property string|null $subject_type
|
|
* @property int|null $subject_id
|
|
* @property array|null $metadata
|
|
* @property string|null $ip_address
|
|
* @property string|null $user_agent
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @mixin \Eloquent
|
|
*/
|
|
class AuditLog extends Model
|
|
{
|
|
protected $fillable = [
|
|
'user_id',
|
|
'action',
|
|
'subject_type',
|
|
'subject_id',
|
|
'metadata',
|
|
'ip_address',
|
|
'user_agent',
|
|
];
|
|
|
|
protected $casts = [
|
|
'metadata' => 'array',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|