auth()->id(), 'user_name' => auth()->user()?->name, 'action' => $action, 'description' => $description, 'subject_type' => $subjectType, 'subject_id' => $subjectId !== null ? (string) $subjectId : null, 'ip_address' => request()->ip(), ]); } public function user() { return $this->belongsTo(User::class); } }