Hide Resources from Panel
Hi I am sure this is simple but cannot see how this is achieved. Say I have a resource "pets" - I get a number of php dfiles generated for this and a link is added to the admin panel - this all happens automatically. I'm doing POC stuff and I'd like to keep what I have (code for reference) but not have the resources cluttering up my admin panel - what's the method (short of deleting the files) to remove them from the view of the user?
I guess one option would be to create a new Laravel app π or to create a new admin panel - but just wanted to know if there is a simple way to achieve the hiding of resources that you don't actually want to see?
thanks
j
3 Replies
Hi, I think you need a Role / Permission for this to hide a resource from the user by their role or you can add this line of code inside your Resource
and if you want to use the Role / Permission based for it you can try to use this plugin
https://filamentphp.com/plugins/bezhansalleh-shield
Filament
Shield by Bezhan Salleh - Filament
The easiest and most intuitive way to add access management to your Filament Panel's Resources, Pages & Widgets through spatie/laravel-permission.
$shouldRegisterNavigation
should be the easiest solutionPerfect - it is exactly what I needed! Many thanks. I also see now where this subjct is described in the documentation - https://filamentphp.com/docs/3.x/panels/navigation#disabling-resource-or-page-navigation-items