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