From bd8e42d3d169d7bd4673453b4875160746957672 Mon Sep 17 00:00:00 2001 From: Vasyka Date: Wed, 5 Aug 2026 20:23:28 +0000 Subject: [PATCH] diag(work-order-dashboard): log every mount + include URL in error Adds Log::warning() on every mount() so we can trace exactly what record id and URL the button navigates to. Also includes the full URL in the "not found" alert so the user can copy it back to us. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/Filament/Tenant/Pages/WorkOrderDashboard.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/Filament/Tenant/Pages/WorkOrderDashboard.php b/app/Filament/Tenant/Pages/WorkOrderDashboard.php index d938881..ab66ced 100644 --- a/app/Filament/Tenant/Pages/WorkOrderDashboard.php +++ b/app/Filament/Tenant/Pages/WorkOrderDashboard.php @@ -35,6 +35,18 @@ class WorkOrderDashboard extends Page public function mount(int|string $record): void { $id = (int) $record; + + // Log every single mount attempt so we can diagnose the exact request + \Log::warning('WorkOrderDashboard.mount', [ + 'record_raw' => $record, + 'record_int' => $id, + 'url' => request()->fullUrl(), + 'referer' => request()->headers->get('referer'), + 'method' => request()->method(), + 'auth_id' => auth()->id(), + 'tenant' => app(\App\Tenancy\TenantManager::class)->current()?->slug, + ]); + $wo = WorkOrder::with([ 'client', 'vehicle', 'master', 'works.labor', 'works.master', @@ -44,14 +56,13 @@ class WorkOrderDashboard extends Page ])->find($id); if (! $wo) { - // Diagnose: does it exist in another tenant? $existsGlobally = WorkOrder::withoutGlobalScopes() ->where('id', $id)->exists(); $tenant = app(\App\Tenancy\TenantManager::class)->current(); $tenantSlug = $tenant?->slug ?? '—'; $msg = $existsGlobally ? sprintf(__('Fișa #%d există, dar nu aparține tenantului „%s".'), $id, $tenantSlug) - : sprintf(__('Fișa #%d nu există. Verifică lista de fișe active.'), $id); + : sprintf(__('Fișa #%d nu există. URL apelat: %s'), $id, request()->fullUrl()); \Filament\Notifications\Notification::make() ->title(__('Fișă indisponibilă')) ->body($msg)