Cannot load routes if path('') is empty
I'm new to filament, so maybe I'm doing something wrong, but in a completely fresh installation of Laravel (just plain Laravel, not Fortify or other frameworks), and a fresh installation of filament, when I change the path from path('dashboard') to path('') in DashboardPanelProvider, filament cannot charge the routes of the pannel once logged in.
Route [filament.dashboard.pages.dashboard] not defined.
Tried to clear cache (both Filament and browser)
Solution:Jump to solution
okay! I found the error after trying a lot of different things! I write the solution here just in case it helps someone in the future. As this is a new installation of Laravel, I forgot to remove the welcome route that was on path /, so this was the thing causing the error.
13 Replies
Did you clear the cache afterwards?
It can be benefical to scope the routes to the domain:
->domain('admin.example.com');
https://filamentphp.com/docs/3.x/panels/configuration#setting-a-domain
I already have the routes under a domain ->domain('dashboard.localhost.test') in my case, that's why I'm using the ->path('').
I tried everything cache-related.
so I have 3 panels and one without the path. I removed the path completely in my scenario
so
->default()
->id('app')
->domain(
config('app.url')
)
It could be you have set default on multiple panels?
I only have one panel, is a fresh installation of Laravel and Filament. I just installed Laravel, just installed Fillament with an id of "dashboard", then I created a user from the console, I tried the route localhost.test/dashboard/login with success, and then I changed the path('') from path('dashboard') to path(''). After this, I added the domain('dashboard.localhost.test'), but this last step didn't matter, because the non-existing view problem appeared since I let the path blank.
btw
return $panel
->default()
->id('dashboard')
->path('')
->domain(config('dashboard_domain')) // Subdomain
then did you run php artisan route:clear ?
just run it again, just in case, same problem
Symfony\Component\Routing\Exception\RouteNotFoundException
Route [filament.dashboard.pages.dashboard] not defined.
Not making much sense... I did have it once but that's when I was calling the route directly
Yeah, didn't make much sense, that's why I was thinking about missing some steps or points as I'm new with Filament and this is the first time I use it. But after reading all the documentation and being sure to clear all cache, I sent this message here.
Try removing the path if you set the domain, I have a feeling that was the issue
so
Solution
okay! I found the error after trying a lot of different things! I write the solution here just in case it helps someone in the future. As this is a new installation of Laravel, I forgot to remove the welcome route that was on path /, so this was the thing causing the error.
So in the end, it was a route collision conflict with the Laravel welcome route, which to be honest I forgot about it completely. My bad. Thanks for the help!
Great find, that was my issue too now I remember hehe