26 خطوط
573 B
PHP
26 خطوط
573 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ActivityLog extends Model
|
|
{
|
|
protected $fillable = [
|
|
'user_id', 'action', 'description',
|
|
'subject_type', 'subject_id', 'ip_address', 'user_agent',
|
|
'before_data', 'after_data', 'request_id',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['before_data' => 'array', 'after_data' => 'array'];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|