F
Filament8mo ago
Troner

My custom filament page is showing the wrong sidebar from different panel

Issue: When i'm on my custom filament page it's showing the wrong sidebar from the AdminPanel even when there is no /admin in the URL. What i tried: When i use ->default() on the UserPanelProvider instead the AdminPanelProvider it works but causing other errors in my app. i also removed /resources/views/vendor; upgraded filament and cleared cache. What i want: it should display the correct sidebar with the current settings below or do i really need to use ->default() on the UserPanelProvider and if yes why?
// UserPanelProvider
return $panel
// ->default()
->id('user')
->path('')
// UserPanelProvider
return $panel
// ->default()
->id('user')
->path('')
// AdminPanelProvider
return $panel
->default()
->id('admin')
->path('admin')
// AdminPanelProvider
return $panel
->default()
->id('admin')
->path('admin')
Solution:
Oh shit, now i know my mistake 🤦‍♂️, i commented out ->discoverPages and didn't add my page in ->pages([]). It works now, thanks for helping. Also i removed it from web.php
Jump to solution
5 Replies
krekas
krekas8mo ago
I would guess it's how you register pages, etc. to the panel
Dennis Koch
Dennis Koch8mo ago
How do you register that page? Path for UserPanel maybe should be /
Troner
TronerOP8mo ago
i made a new page for testing with php artisan make:filament-page TestPage and selected the user panel and then register it in web.php with Route::get('test-page', \App\Filament\Pages\TestPage::class); and then i get the sidebar from the admin. Also i now use ->path('/') in UserPanelProvider
krekas
krekas8mo ago
Why do you add route in the web.php?
Solution
Troner
Troner8mo ago
Oh shit, now i know my mistake 🤦‍♂️, i commented out ->discoverPages and didn't add my page in ->pages([]). It works now, thanks for helping. Also i removed it from web.php
Want results from more Discord servers?
Add your server