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
LeandroFerreira15mo ago
Does it work if you delete this page?
code eater
code eater15mo ago
nope just 404 should i recreate again?
LeandroFerreira
LeandroFerreira15mo ago
Filament
Custom pages - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
code eater
code eater15mo ago
i use php artisan make:filament-page UserDash --resource=UserResource --type=custom to create it
LeandroFerreira
LeandroFerreira15mo ago
Ok, but without the other error
code eater
code eater15mo ago
yea, i believe the previous on was from me create the route manually
code eater
code eater15mo ago
now am just stuck with 404
LeandroFerreira
LeandroFerreira15mo ago
Did you register it in your resource?
Filament
Filament15mo 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 Harrin15mo ago
please share a flare error url
code eater
code eater15mo ago
code eater
code eater15mo ago
currently working locally
LeandroFerreira
LeandroFerreira15mo ago
Solved?
code eater
code eater15mo ago
i meant i am developing locally
LeandroFerreira
LeandroFerreira15mo ago
Is the page working now?
code eater
code eater15mo ago
not at all i can't access it
LeandroFerreira
LeandroFerreira15mo ago
try to add the page after index page
code eater
code eater15mo ago
do i need to register the route manually to the web.php?
LeandroFerreira
LeandroFerreira15mo ago
'index' => xx, 'dashboard' => xx ...
code eater
code eater15mo ago
same 404 error
code eater
code eater15mo ago
LeandroFerreira
LeandroFerreira15mo ago
can you share the code please?
code eater
code eater15mo 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
LeandroFerreira15mo ago
url /users/dashboard?
code eater
code eater15mo 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
LeandroFerreira15mo ago
should work
code eater
code eater15mo ago
doesn't at all
Dan Harrin
Dan Harrin15mo ago
please share the flare url of the error you got before the exception
code eater
code eater15mo ago
no error currently just 404 page
LeandroFerreira
LeandroFerreira15mo ago
Isn't the users/dashboard route in the web.php, right?
code eater
code eater15mo ago
no
Dan Harrin
Dan Harrin15mo ago
check “artisan route:list”
code eater
code eater15mo ago
ok
code eater
code eater15mo ago
it exist and is registered
LeandroFerreira
LeandroFerreira15mo ago
can you share the whole code please?
code eater
code eater15mo ago
yea
code eater
code eater15mo 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
LeandroFerreira15mo ago
should work 😅 php artisan route:clear ?
code eater
code eater15mo ago
didn't still 404 i have been running route optimize
LeandroFerreira
LeandroFerreira15mo ago
try to change the route name, ex 'dash' => Pages\UserDash::route('/dash'),
code eater
code eater15mo ago
ok
Dan Harrin
Dan Harrin15mo 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 eater15mo 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
LeandroFerreira15mo ago
Didn't 'dash' work?
code eater
code eater15mo ago
code eater
code eater15mo ago
it didn't Create doesn't work anymore, throws 404
LeandroFerreira
LeandroFerreira15mo ago
hum? view, edit?
code eater
code eater15mo ago
they work but when i remove 'dash' => Pages\UserDash::route('/dash'), the create works again
LeandroFerreira
LeandroFerreira15mo ago
after create? 'create' => Pages\CreateUser::route('/create'), 'dash' => Pages\UserDash::route('/dash'), Does create work?
code eater
code eater15mo ago
create stops working
LeandroFerreira
LeandroFerreira15mo ago
and /dash?
code eater
code eater15mo ago
404 error
LeandroFerreira
LeandroFerreira15mo ago
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 eater15mo ago
ok same thing
LeandroFerreira
LeandroFerreira15mo ago
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 eater15mo ago
should i create a standalone resource and see if it will work? Same error 404
LeandroFerreira
LeandroFerreira15mo ago
Are you able to share your project in github? Send me a DM please
code eater
code eater15mo ago
ok Yes
LeandroFerreira
LeandroFerreira15mo ago
Hi @codeheater , it is ok now, right? 👍
code eater
code eater15mo ago
Sorry am outdoor atm, will give you an update in a moment yea, it's okay now . Thanks so much.
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
LeandroFerreira14mo ago
Can you share the code please?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
LeandroFerreira14mo ago
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 User14mo ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
LeandroFerreira14mo ago
my bad, the order shouldn't be the issue what is the error on the browser?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
LeandroFerreira14mo ago
the previous issue was a duplicated resource. Can you share a print of the resource folder in your project?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
LeandroFerreira14mo ago
Filament
Viewing records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
LeandroFerreira
LeandroFerreira14mo ago
run php artisan route:list --name="ecoles"
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View