Route [filament.app.resources.events.index] not defined.
Hi! When using url(route('filament.app.resources.events.index', ['tenant' => Filament::getTenant()])) in the AppPanelProvider I get Route [filament.app.resources.events.index] not defined.
php artisan route:list --name=events
GET|HEAD {tenant}/events ............... filament.app.resources.events.index › App\Filament\Resources\EventResource\Pages\ListEvents Using the same url(route('filament.app.resources.events.index', ['tenant' => Filament::getTenant()])) on the EventResource/Pages/ListEvents.php works. Why? Is the named routes not available in the AppPanelProvider?
GET|HEAD {tenant}/events ............... filament.app.resources.events.index › App\Filament\Resources\EventResource\Pages\ListEvents Using the same url(route('filament.app.resources.events.index', ['tenant' => Filament::getTenant()])) on the EventResource/Pages/ListEvents.php works. Why? Is the named routes not available in the AppPanelProvider?
Solution:Jump to solution
1. Don't call routes directly. Use
EventResource::getUrl()
2. The routes probably haven't been registered yet. Try wrapping the code in a Closure...2 Replies
Solution
1. Don't call routes directly. Use
EventResource::getUrl()
2. The routes probably haven't been registered yet. Try wrapping the code in a ClosureThanks!
\Filament\Navigation\NavigationItem::make('Auskultation')
->url(function() {
return EventResource::getUrl() . '?activeTab=Auscultation';
}) Works!