F
Filamentβ€’16mo ago
GavTheDev

Confused about multiple dashboards

According to the docs any page you add to App/Filament/Pages that extends Filament\Pages\Dashboard will be available as a new dashboard. However, whatever I add breaks the admin with Route [filament.admin.pages.dashboard-one] not defined.. I tried adding the pages explicitly to $panel->pages() but the error remains. What am I missing?
9 Replies
Patrick Boivin
Patrick Boivinβ€’16mo ago
I'm not sure what is causing the issue but you may be able to use a regular page instead of a dashboard, as a workaround... You can add widgets to the page in getHeaderWidgets().
GavTheDev
GavTheDevOPβ€’16mo ago
Thanks, actually I'm just checking out the new features and stumbled upon this issue and was wondering if I did something wrong. I don't really need it πŸ™‚
Dan Harrin
Dan Harrinβ€’16mo ago
@gavthedev maybe try overriding routes() on the page so that it registers them to a different URL so its different im guessing the error is because the duplicate page is trying to register itself to the same URL, so the route is not defined and the error is caused
DariusIII
DariusIIIβ€’16mo ago
I have the same issue, i have created Admin and User dashboards, but both routes are registered to user one, and admin is reporting missing route. I have defined user and admin routes, but still having the route error. So i am using same dashborad for both currently.
Dan Harrin
Dan Harrinβ€’16mo ago
so you can override routes() like I said
Andrew Wallo
Andrew Walloβ€’16mo ago
Make sure you are using a closure with the url() when doing something like this:
->userMenuItems([
'profile' => MenuItem::make()
->label('Profile')
->icon('heroicon-o-user-circle')
->url(static fn() => route('filament.user.pages.profile')),
])
->userMenuItems([
'profile' => MenuItem::make()
->label('Profile')
->icon('heroicon-o-user-circle')
->url(static fn() => route('filament.user.pages.profile')),
])
GavTheDev
GavTheDevOPβ€’16mo ago
Overriding routes() does the trick, thanks, but isn't the slug automatically generated from the page class name then? This would produce different slugs πŸ€”
DariusIII
DariusIIIβ€’16mo ago
I can confirm that route overriding works in my case too.
Dan Harrin
Dan Harrinβ€’16mo ago
the slug cant be blank hence why we dont use it in the overriden routes() method for the default dashboard this should be documented though
Want results from more Discord servers?
Add your server