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
awcodes
awcodes7d ago
I don’t think pages are auto discovered. So, you need to add them manually to the ->pages() in the panel provider.
dubayd
dubaydOP7d ago
No description
dubayd
dubaydOP7d ago
this is what i have now and i am trying to add a third but i didnt have to add this one manually either?
awcodes
awcodes7d ago
Actually they are auto discovered if they are in the directory defined by discover pages in the panel provider.
dubayd
dubaydOP7d ago
under my filament map i dont have a pages directory only resources
awcodes
awcodes7d ago
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?
dubayd
dubaydOP7d ago
i have a accesmanagement plugin
awcodes
awcodes7d ago
How did you create the page?
dubayd
dubaydOP7d ago
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.
dubayd
dubaydOP7d ago
i tried disabling it but nothing changed via command: php artisan make:filament-page
awcodes
awcodes7d ago
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.
dubayd
dubaydOP7d ago
No description
dubayd
dubaydOP7d ago
this is all i have in the filament map
awcodes
awcodes7d ago
Where is the actual page class located? The make command should have put it in a Pages directory
dubayd
dubaydOP7d ago
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?
awcodes
awcodes7d ago
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.
dubayd
dubaydOP7d ago
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
awcodes
awcodes7d ago
Do you have a repo you could share? Something just isn’t adding up.
dubayd
dubaydOP7d ago
https://github.com/tallandcollege/portfolio-project-2-ensar-moskee its a repo from school so im not sure if u can access it
awcodes
awcodes7d ago
Yea. It’s private. Do you have an AanmeldingResource.php?
dubayd
dubaydOP7d ago
yes
awcodes
awcodes7d ago
And can you show me what’s in the resource folder for it.
dubayd
dubaydOP7d ago
these 3 files
dubayd
dubaydOP7d ago
No description
dubayd
dubaydOP7d ago
i tried to create it again so the name is a little different
awcodes
awcodes7d ago
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.
dubayd
dubaydOP7d ago
oh i am trying to create a resource
awcodes
awcodes7d ago
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()
dubayd
dubaydOP7d ago
its my first time using it asswel i tried disabling it but it since i dont need the use for it yet
awcodes
awcodes7d ago
That’s the only thing I can think of as being the cause at the moment.
dubayd
dubaydOP7d ago
it has only caused problems so far
awcodes
awcodes7d ago
Permission and roles can be complicated.
dubayd
dubaydOP7d ago
can i remove it completly? without deleting my other resource
awcodes
awcodes7d ago
Yea, but you’ll also need to either remove the database stuff manually or do a migrate fresh.
dubayd
dubaydOP7d ago
thats not a problem
awcodes
awcodes7d ago
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.
dubayd
dubaydOP7d ago
ill try using that one thanks for your help!
awcodes
awcodes7d ago
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.

Did you find this page helpful?