$userId ?? auth()->id(), 'action' => $action, 'description' => $description, 'subject_type' => $subject ? get_class($subject) : null, 'subject_id' => $subject?->id, 'metadata' => $metadata, 'created_at' => now(), ]); } }