F
Filament6mo ago
dasK_

Filament Page In the Wrong Panel?

I have two panels, Admin and userPanel, all of my pages seem to be working just fine and displaying the panel for the folder/namespace they're in (routes look good too) I have one page in my userPanel that displays the admin panel? I've checked the folder path of the Component and Blade Blade: views/filament/user-panel/pages/top-up.blade.php Component: app/filament/UserPanel/Pages/TopUp.php
namespace App\Filament\UserPanel\Pages;
namespace App\Filament\UserPanel\Pages;
in my provider files admin
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
userPanel
->discoverResources(in: app_path('Filament/UserPanel/Resources'), for: 'App\\Filament\\UserPanel\\Resources')
->discoverPages(in: app_path('Filament/UserPanel/Pages'), for: 'App\\Filament\\UserPanel\\Pages')
->discoverResources(in: app_path('Filament/UserPanel/Resources'), for: 'App\\Filament\\UserPanel\\Resources')
->discoverPages(in: app_path('Filament/UserPanel/Pages'), for: 'App\\Filament\\UserPanel\\Pages')
Can't seem to figure out what's happening here especially when all of the other userPanel pages are fine Generated Route
GET|HEAD userPanel/top-up ......................................................................................................................................................................... filament.userPanel.pages.top-up › App\Filament\UserPanel\Pages\TopUp
GET|HEAD userPanel/top-up ......................................................................................................................................................................... filament.userPanel.pages.top-up › App\Filament\UserPanel\Pages\TopUp
Solution:
Figured it out, I was trying to use Laravel routes in web.php, Filament only works properly with ``` protected static ?string $slug = 'top-up/{orderNumber}'; protected static bool $shouldRegisterNavigation = false;...
Jump to solution
2 Replies
dasK_
dasK_6mo ago
I've put a Log::info('UserPanel route: ' . config('your.config.route')); in the mount, and I get the expected output [2024-02-03 05:21:01] local.INFO: UserPanel route: I also do have another page called TopUp in the admin panel, but I completely renamed the userPanel one, still the same outcome, and to the best of my knowledge.. it should work as I'm doing the same thing for my order page
Solution
dasK_
dasK_6mo ago
Figured it out, I was trying to use Laravel routes in web.php, Filament only works properly with
protected static ?string $slug = 'top-up/{orderNumber}';
protected static bool $shouldRegisterNavigation = false;
protected static ?string $slug = 'top-up/{orderNumber}';
protected static bool $shouldRegisterNavigation = false;
Want results from more Discord servers?
Add your server
More Posts