created_by = Auth::id() ?? null; }); static::updating(function ($model) { $model->updated_by = Auth::id() ?? null; }); } }