F
Filament7mo ago
dyo

Route [filament.pages.dashboard] not defined after filament upgrade

I just upgrading my filament version to v3. After running php artisan filament:install, i got error *Route [filament.pages.dashboard] not defined. * in /admin. I'm using custom Dashboard, and i've followed the steps from here https://filamentphp.com/docs/3.x/panels/dashboard#customizing-the-dashboard-page I've also tried running php artisan optimize. what am I missing?
12 Replies
toeknee
toeknee7mo ago
php artisan cache:clear What did you upgrade from?
dyo
dyoOP7mo ago
i've tried cache:clear, still undefined. i'm upgrading from v2..
Tetracyclic
Tetracyclic7mo ago
Presumably you've run php artisan optimize:clear as well? Though you mentioned you've run php artisan optimize, which should have solved it if that was the issue. If you run php artisan route:list, do you see the dashboard route listed at all?
dyo
dyoOP7mo ago
@Tetracyclic i've just tried php artisan optimize:clear, still undefined.. that's the problem, in route:list the dashboard route is missing. GET|HEAD / ................................................................................................................................................................................ GET|HEAD admin ............................................................................................................................................................................ what should i do to redefined it?
Tetracyclic
Tetracyclic7mo ago
The route gets registered by the page generating it, in this case your dashboard. Presumably your dashboard is extending Filament\Pages\Dashboard? Are you overriding any of the default properties or methods in your custom dashboard?
dyo
dyoOP7mo ago
i've done nothing with my Dashboard class, other than changing the extend from Page class to Filament\Pages\Dashboard..
Tetracyclic
Tetracyclic7mo ago
GET|HEAD admin How is this route defined? That should be the dashboard route.
dyo
dyoOP7mo ago
it's just dots..
No description
Tetracyclic
Tetracyclic7mo ago
What's the output from php artisan route:list -vvv --path="admin" --json Also, if you search your codebase for get('admin' does anything come up? It seems like that route might be getting registered before Filament can register it.
dyo
dyoOP7mo ago
this is the output { "domain":null, "method":"GET|HEAD", "uri":"admin", "name":null, "action":"Closure", "middleware":[ "App\Http\Middleware\EncryptCookies","Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse","Illuminate\Session\Middleware\StartSession","Illuminate\View\Middleware\ShareErrorsFromSession","App\Http\Middleware\VerifyCsrfToken","Illuminate\Routing\Middleware\SubstituteBindings","App\Http\Middleware\SidonatSubscriptionMiddleware" ] }, i've got nothing if I search that..
Tetracyclic
Tetracyclic7mo ago
So that route isn't being registered by Filament, it's just got the default Laravel middleware. Something else, either a package or app code must be registering it and overriding the Filament route.
dyo
dyoOP7mo ago
nevermind, after some more digging, there's mistake in my web route.. thanks for helping me before..
Want results from more Discord servers?
Add your server