From 67a87c5a675374d18d6b649ae2edffba60ed6949 Mon Sep 17 00:00:00 2001 From: Vasyka Date: Wed, 5 Aug 2026 19:46:52 +0000 Subject: [PATCH] fix(edit-wo): resolve dashboard URL via $livewire, not $this MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inside a Filament Action's ->url() closure, \$this can bind to the Action instance rather than the Livewire page — so \$this->record was null and the generated URL became /app/work-orders//dashboard, which routed as record='' and hit our friendly redirect for id 0. Switch to \$livewire and prefer getRecord() which is always populated. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Tenant/Resources/WorkOrderResource/Pages/EditWorkOrder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Tenant/Resources/WorkOrderResource/Pages/EditWorkOrder.php b/app/Filament/Tenant/Resources/WorkOrderResource/Pages/EditWorkOrder.php index 750b318..2b5a67b 100644 --- a/app/Filament/Tenant/Resources/WorkOrderResource/Pages/EditWorkOrder.php +++ b/app/Filament/Tenant/Resources/WorkOrderResource/Pages/EditWorkOrder.php @@ -36,7 +36,7 @@ class EditWorkOrder extends EditRecord ->label(__('Vizualizare dashboard')) ->icon('heroicon-m-squares-2x2') ->color('info') - ->url(fn () => url('/app/work-orders/' . $this->record->id . '/dashboard')), + ->url(fn ($livewire) => url('/app/work-orders/' . ($livewire->record?->id ?? $livewire->getRecord()?->id) . '/dashboard')), Actions\Action::make('apply_template') ->label(__('Aplică șablon')) ->icon('heroicon-m-clipboard-document-list')