Routes in web.php don't work if its the top level
I am using filamentphp with multi tenancy.
I am currently trying to install clockwork but it I cannot access the /clockwork uri. Anyways. I tracked down the problem to all urls which are for example localhost/test or localhost/example. Everything such as /localhost/test/test or localhost/foo/bar works.
Is this a known thing? Any way to bypass it?
My localhost/test route does show up on php artisan route:list:
10 Replies
With "don't work" I mean it gets a 404 error.
What are you panel paths look like?
I have one /admin panel which is not multi tenant and one 'app' which path is:
So the path is ''. That is probably the issue but the routes that dont work are above the 'app' route in the route:list command.
It’s because everything is treated as the tenant.
As far as I know in laravel if you have routes before a catch-all route, it should work. I however didnt find where filament registers its routes so it must be somewhere before the web.php registration.
Good question. From what it looks like it should be after your rout (if the order of the route:list command is correct)
I don't know how route:list actually works (maybe its sorted alphabetically). It will have to see where filament hooks in to define its routes. Maybe someone knows where it does that so I would have to give the web.php priority.
My providers array in app.php does have the filament routes at the very end:
Then I guess it should register after all those. Hm, weird. Is it really the tenant route that captures your other routes?
Yes I think so, commenting out the App\Providers\Filament\AppPanelProvider::class, solves the issue and that is where I have my tenant route with path being ''
Confirmed, that it is the tenant route