Moving route registration removes theme css styling
I want to dynamically determine resource pages.
Old setup works:
But when I remove the
'stats'
line, and add this:
the page still loads, but the Filament theme styling is gone.
- No console errors
- No laravel errors
- Livewire still works fine
- route::list gives same result for the stats route, before and after the change
- Custom theme styling gone
- Also, Vite stops hot reloading
Any help is appreciated.2 Replies
Why would you like to add this in the web.php?
Ultimately I want to register routes depending on the current tenant.
So next step is
tenantConfig()->registerRoutes()
which is a helper to get current tenant. But even directly in web.php fails.
After some more investigation:
Every request hits Filament::registerViteTheme()
in service provider. Also the broken theme request.
But; the broken page only loads /filament/assets/app.css?id=ceb9a486dfc44ebe8adaa3bd510821e8
in network tab.
While all other pages load http://[::1]:5173/resources/css/filament.css
(and a bunch of custom stuff I put in the service provider).
I've restarted npm run dev
and run artisan optimize:clear
Any clue?
Is there something magic about getPages()
that makes custom styling work? I'm still stumped...