Issue when creating a custom page

i get this error after setting up a custom page and here is my code use Filament\Resources\Pages\Page; use App\Filament\Resources\UserResource; class UserDashboard extends Page { protected static string $resource = UserResource::class; protected static ?string $navigationGroup = 'Manage Users'; protected static string $view = 'filament.resources.user-resource.pages.user-dashboard'; } and my blade file <x-filament::page> <p> hello </p> </x-filament::page> in my AppService Provider i have this Filament::registerNavigationItems([ NavigationItem::make('Analytics') ->url(UserResource::getUrl('dashboard') ) ->icon('heroicon-o-presentation-chart-line') ->activeIcon('heroicon-s-presentation-chart-line') ->group('Manage Users') ->sort(2), ]); currently now clicking on this link returns 404
75 Replies
LeandroFerreira
Does it work if you delete this page?
code eater
code eaterOP2y ago
nope just 404 should i recreate again?
LeandroFerreira
Filament
Custom pages - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
code eater
code eaterOP2y ago
i use php artisan make:filament-page UserDash --resource=UserResource --type=custom to create it
LeandroFerreira
Ok, but without the other error
code eater
code eaterOP2y ago
yea, i believe the previous on was from me create the route manually
code eater
code eaterOP2y ago
now am just stuck with 404
LeandroFerreira
Did you register it in your resource?
Filament
Filament2y ago
We need more information to help you debug your problem. Please click on the top left 'SHARE' button of the error page you're seeing and share the link with us.
Dan Harrin
Dan Harrin2y ago
please share a flare error url
code eater
code eaterOP2y ago
code eater
code eaterOP2y ago
currently working locally
LeandroFerreira
Solved?
code eater
code eaterOP2y ago
i meant i am developing locally
LeandroFerreira
Is the page working now?
code eater
code eaterOP2y ago
not at all i can't access it
LeandroFerreira
try to add the page after index page
code eater
code eaterOP2y ago
do i need to register the route manually to the web.php?
LeandroFerreira
'index' => xx, 'dashboard' => xx ...
code eater
code eaterOP2y ago
same 404 error
code eater
code eaterOP2y ago
LeandroFerreira
can you share the code please?
code eater
code eaterOP2y ago
from the resource public static function getPages(): array { return [ 'index' => Pages\ListUsers::route('/'), 'dashboard' => Pages\UserDash::route('/dashboard'), 'create' => Pages\CreateUser::route('/create'), 'view' => Pages\ViewUser::route('/{record}'), 'edit' => Pages\EditUser::route('/{record}/edit'), ]; }
LeandroFerreira
url /users/dashboard?
code eater
code eaterOP2y ago
my page class UserDash extends Page { protected static string $resource = UserResource::class; protected static string $view = 'filament.resources.user-resource.pages.user-dash'; } yea http://docsaas-admin.test/admin/users/dashboard
LeandroFerreira
should work
code eater
code eaterOP2y ago
doesn't at all
Dan Harrin
Dan Harrin2y ago
please share the flare url of the error you got before the exception
code eater
code eaterOP2y ago
no error currently just 404 page
LeandroFerreira
Isn't the users/dashboard route in the web.php, right?
code eater
code eaterOP2y ago
no
Dan Harrin
Dan Harrin2y ago
check “artisan route:list”
code eater
code eaterOP2y ago
ok
code eater
code eaterOP2y ago
it exist and is registered
LeandroFerreira
can you share the whole code please?
code eater
code eaterOP2y ago
yea
code eater
code eaterOP2y ago
UserDash.php namespace App\Filament\Resources\UserResource\Pages; use App\Filament\Resources\UserResource; use Filament\Resources\Pages\Page; class UserDash extends Page { protected static string $resource = UserResource::class; protected static string $view = 'filament.resources.user-resource.pages.user-dash'; } UserResource.php
LeandroFerreira
should work 😅 php artisan route:clear ?
code eater
code eaterOP2y ago
didn't still 404 i have been running route optimize
LeandroFerreira
try to change the route name, ex 'dash' => Pages\UserDash::route('/dash'),
code eater
code eaterOP2y ago
ok
Dan Harrin
Dan Harrin2y ago
dude there must be something glaringly obvious here that is missing can you send the .env? also does admin/users/create work?
code eater
code eaterOP2y ago
yea, all the rest works except the custom page public static function getPages(): array { return [ 'index' => Pages\ListUsers::route('/'), 'dash' => Pages\UserDash::route('/dash'), 'create' => Pages\CreateUser::route('/create'), 'view' => Pages\ViewUser::route('/{record}'), 'edit' => Pages\EditUser::route('/{record}/edit'), ]; }
LeandroFerreira
Didn't 'dash' work?
code eater
code eaterOP2y ago
code eater
code eaterOP2y ago
it didn't Create doesn't work anymore, throws 404
LeandroFerreira
hum? view, edit?
code eater
code eaterOP2y ago
they work but when i remove 'dash' => Pages\UserDash::route('/dash'), the create works again
LeandroFerreira
after create? 'create' => Pages\CreateUser::route('/create'), 'dash' => Pages\UserDash::route('/dash'), Does create work?
code eater
code eaterOP2y ago
create stops working
LeandroFerreira
and /dash?
code eater
code eaterOP2y ago
404 error
LeandroFerreira
Can you try this please?
use Filament\Resources\Pages\CreateRecord;
class UserDash extends CreateRecord
use Filament\Resources\Pages\CreateRecord;
class UserDash extends CreateRecord
code eater
code eaterOP2y ago
ok same thing
LeandroFerreira
and this?
//'create' => Pages\CreateUser::route('/create'),
'dash' => Pages\UserDash::route('/dash'),
//'create' => Pages\CreateUser::route('/create'),
'dash' => Pages\UserDash::route('/dash'),
code eater
code eaterOP2y ago
should i create a standalone resource and see if it will work? Same error 404
LeandroFerreira
Are you able to share your project in github? Send me a DM please
code eater
code eaterOP2y ago
ok Yes
LeandroFerreira
Hi @codeheater , it is ok now, right? 👍
code eater
code eaterOP2y ago
Sorry am outdoor atm, will give you an update in a moment yea, it's okay now . Thanks so much.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
Can you share the code please?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
try
return [
'index' => Pages\ListEcoles::route('/'),
'create' => Pages\CreateEcole::route('/create'),
'edit' => Pages\EditEcole::route('/{record}/edit'),
'view' => Pages\ViewEcole::route('/{record}'),
];
return [
'index' => Pages\ListEcoles::route('/'),
'create' => Pages\CreateEcole::route('/create'),
'edit' => Pages\EditEcole::route('/{record}/edit'),
'view' => Pages\ViewEcole::route('/{record}'),
];
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
my bad, the order shouldn't be the issue what is the error on the browser?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
the previous issue was a duplicated resource. Can you share a print of the resource folder in your project?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
Filament
Viewing records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
run php artisan route:list --name="ecoles"
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server