Pages not showing on navigation
Hi, I am trying to create a new page to add to my admin panel but everytime i create a page it doesnt show on the navigation menu can anyone help?
38 Replies
I don’t think pages are auto discovered. So, you need to add them manually to the ->pages() in the panel provider.

this is what i have now and i am trying to add a third
but i didnt have to add this one manually either?
Actually they are auto discovered if they are in the directory defined by discover pages in the panel provider.
under my filament map i dont have a pages directory
only resources
If it not showing up then it either a cache issue or something is preventing it from loading via the canAccess() method. Do you have any roles and permissions plugins installed?
i have a accesmanagement plugin
How did you create the page?
Filament
Access-Management by Solution Forest - Filament
This is total different concept on handle role and permission. A RBAC permission control through spatie/laravel-permission.
i tried disabling it but nothing changed
via command: php artisan make:filament-page
Then you should have an App/Filament/Pages directory
Where the page class is.
If it’s in that directory then it should be auto discovered.

this is all i have in the filament map
Where is the actual page class located? The make command should have put it in a Pages directory
it didnt i guess
but i havent got anything for my activityresource in the pages directory and it does show
so why doesnt the aanmelding one show?
Resources and pages are two different things. If the resource isn’t showing then my guess is something with the permissions plugin.
Like, the user doesn’t have permission to manage the resource.
ye could be but it is a super-admin so it should have all permissions
is there anyway to force show it on the navigation menu
Do you have a repo you could share? Something just isn’t adding up.
https://github.com/tallandcollege/portfolio-project-2-ensar-moskee
its a repo from school so im not sure if u can access it
Yea. It’s private.
Do you have an AanmeldingResource.php?
yes
And can you show me what’s in the resource folder for it.
these 3 files

i tried to create it again so the name is a little different
I think the original was probably fine if you did the make:filament-resource command, but your question is about a custom page and not a resource so I’m a little confused.
oh
i am trying to create a resource
I’ve never used that particular permissions plugin, but I’m leaning toward it not knowing about the new resource, ie it probably has a command to regenerate permissions when new resources are created.
Something along those lines. Even with a super admin it would depend on if the super admin is run through Gate::before() or Gate::after()
its my first time using it asswel
i tried disabling it but it since i dont need the use for it yet
That’s the only thing I can think of as being the cause at the moment.
it has only caused problems so far
Permission and roles can be complicated.
can i remove it completly?
without deleting my other resource
Yea, but you’ll also need to either remove the database stuff manually or do a migrate fresh.
thats not a problem
The Shield plugin is probably the best one out there. But I’ve also started just using this one with policies since filament defaults to policy files. https://github.com/eneadm/ladder
GitHub
GitHub - eneadm/ladder: Lightweight Permissions for Laravel
Lightweight Permissions for Laravel. Contribute to eneadm/ladder development by creating an account on GitHub.
ill try using that one thanks for your help!
I like the ladder one because it only has one table in the db and all the roles and permissions are done in the code meaning less db calls on every request. But if you need to be able to manages the roles and permissions in the app via resources then I’d go with shield.