logFillable() ->logOnlyDirty() ->dontSubmitEmptyLogs() ->setDescriptionForEvent(fn (string $event) => match ($event) { 'created' => 'creat', 'updated' => 'modificat', 'deleted' => 'șters', 'restored' => 'restaurat', default => $event, }); } public function tapActivity(Activity $activity, string $eventName): void { // Auto-attach company_id if available. $tenantId = app(TenantManager::class)->currentId() ?: ($this->company_id ?? null); if ($tenantId) { $activity->company_id = $tenantId; } // Auto-attach causer if logged in. if (auth()->check() && ! $activity->causer_id) { $activity->causer_type = get_class(auth()->user()); $activity->causer_id = auth()->id(); } } }