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'))
|
->label(__('Vizualizare dashboard'))
|
||||||
->icon('heroicon-m-squares-2x2')
|
->icon('heroicon-m-squares-2x2')
|
||||||
->color('info')
|
->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')
|
Actions\Action::make('apply_template')
|
||||||
->label(__('Aplică șablon'))
|
->label(__('Aplică șablon'))
|
||||||
->icon('heroicon-m-clipboard-document-list')
|
->icon('heroicon-m-clipboard-document-list')
|
||||||
|
|||||||
@@ -532,7 +532,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@forelse ($history as $h)
|
@forelse ($history as $h)
|
||||||
<div class="wd-history-item">
|
<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 class="h-date">{{ $h->opened_at?->format('d.m.Y') }}</span>
|
||||||
<span>{{ $h->number }}</span>
|
<span>{{ $h->number }}</span>
|
||||||
</a>
|
</a>
|
||||||
@@ -793,12 +793,12 @@
|
|||||||
<div class="wd-bottom">
|
<div class="wd-bottom">
|
||||||
<div class="wd-bottom-nav">
|
<div class="wd-bottom-nav">
|
||||||
@if ($prev)
|
@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>
|
← {{ __('Precedent') }} <span style="color:var(--wd-text-3);">({{ $prev->number }})</span>
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@if ($next)
|
@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>
|
{{ __('Următor') }} → <span style="color:var(--wd-text-3);">({{ $next->number }})</span>
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Reference in New Issue
Block a user