useLogName('permission-management') ->logOnly(['name', 'guard_name', 'is_active']) ->logOnlyDirty() ->dontSubmitEmptyLogs(); } /** * Fillable attributes */ protected $fillable = [ 'name', 'scope', 'guard_name', 'is_active', 'created_by', 'updated_by', ]; /** * Casting */ protected $casts = [ 'is_active' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; /** * Boot model to automatically set created_by & updated_by */ protected static function boot() { parent::boot(); } /** * Audit trail relations */ public function creator() { return $this->belongsTo(User::class, 'created_by'); } public function updater() { return $this->belongsTo(User::class, 'updated_by'); } }