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
php artisan cache:clear
What did you upgrade from?
i've tried cache:clear, still undefined.
i'm upgrading from v2..
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?@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?
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?i've done nothing with my Dashboard class, other than changing the extend from Page class to Filament\Pages\Dashboard..
GET|HEAD admin
How is this route defined? That should be the dashboard route.it's just dots..
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.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..
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.
nevermind, after some more digging, there's mistake in my web route..
thanks for helping me before..