fix(dashboard): replace route() with url() — Filament auto-name has literal {record}
Filament auto-generates route names from the URL slug, so my custom
Page with slug 'work-orders/{record}/dashboard' got the ugly name
'filament.tenant.pages.work-orders.{record}.dashboard' — where
'{record}' is treated as a literal segment in the name, breaking
route() lookups.
Switch all links + the header-action URL to url('/app/work-orders/'
. \$id . '/dashboard') so they resolve correctly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ class EditWorkOrder extends EditRecord
|
||||
->label(__('Vizualizare dashboard'))
|
||||
->icon('heroicon-m-squares-2x2')
|
||||
->color('info')
|
||||
->url(fn () => route('filament.tenant.pages.work-order-dashboard', ['record' => $this->record->id])),
|
||||
->url(fn () => url('/app/work-orders/' . $this->record->id . '/dashboard')),
|
||||
Actions\Action::make('apply_template')
|
||||
->label(__('Aplică șablon'))
|
||||
->icon('heroicon-m-clipboard-document-list')
|
||||
|
||||
@@ -532,7 +532,7 @@
|
||||
</div>
|
||||
@forelse ($history as $h)
|
||||
<div class="wd-history-item">
|
||||
<a href="{{ route('filament.tenant.pages.work-order-dashboard', ['record' => $h->id]) }}">
|
||||
<a href="{{ url('/app/work-orders/' . $h->id . '/dashboard') }}">
|
||||
<span class="h-date">{{ $h->opened_at?->format('d.m.Y') }}</span>
|
||||
<span>{{ $h->number }}</span>
|
||||
</a>
|
||||
@@ -793,12 +793,12 @@
|
||||
<div class="wd-bottom">
|
||||
<div class="wd-bottom-nav">
|
||||
@if ($prev)
|
||||
<a class="wd-btn" href="{{ route('filament.tenant.pages.work-order-dashboard', ['record' => $prev->id]) }}">
|
||||
<a class="wd-btn" href="{{ url('/app/work-orders/' . $prev->id . '/dashboard') }}">
|
||||
← {{ __('Precedent') }} <span style="color:var(--wd-text-3);">({{ $prev->number }})</span>
|
||||
</a>
|
||||
@endif
|
||||
@if ($next)
|
||||
<a class="wd-btn" href="{{ route('filament.tenant.pages.work-order-dashboard', ['record' => $next->id]) }}">
|
||||
<a class="wd-btn" href="{{ url('/app/work-orders/' . $next->id . '/dashboard') }}">
|
||||
{{ __('Următor') }} → <span style="color:var(--wd-text-3);">({{ $next->number }})</span>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user