Is it possible to add resources inside a new folder ?
I want to add different folders inside Filament/Resources
ex: Customer, Order etc...
I have updated AdminPanelProvider discovering to:
->discoverResources(in: app_path('Filament/Resources/'), for: 'App\\Filament\\Resources\\')
->discoverPages(in: app_path('Filament/Pages/'), for: 'App\\Filament\\Pages\\')
->discoverWidgets(in: app_path('Filament/Widgets/'), for: 'App\\Filament\\Widgets\\')
9 Replies
Yes you can, when creating resources you can prefix them, and it will create a sub-namespace. Consider the following command.
I have set the namespace but now the navigation bar is not being rendered
If you've already created resources then you can move them into a sub-namespace folder and adjust the namespace of your resource, relation managers, and pages. Also, remember to edit the imports in your pages and relation manager.
Check if you've added either the
$shouldRegisterNavigation
property or the shouldRegisterNavigation
method on your resource class. If either of them is returning false then it will render in navigation.Thank you
Is your issue resolved?
Nope
I don’t think the discovery is like grep so it’s not looking for something like nested folders it’s looking for classes at the root path that is defined. I could be wrong though.
I ended up using the navigation method in AdminPanelProvider
But I have no idea how to access the resources now due to url changing
The url shouldn’t have changed.
The URLs aren’t defined by the namespaces of the classes.