Change Resources Path

Hello guys, theres any way to change the path from Resources? For example I use the nwidart modules and I would like to change the Resources path to any module I have.
13 Replies
Vp
Vp15mo ago
You can change like this protected static ?string $slug = 'custom-url-slug';
André Rodrigues
André RodriguesOP15mo ago
Not the url, but the path where is created, it's where the Filement see the php classes.
Vp
Vp15mo ago
Oh sorry didn't read properly, and I don't have any idea then.. sorry 😅
awcodes
awcodes15mo ago
The make:filament-resource command doesn’t really support custom paths, iirc, but it easy enough to use it, move the files and change the name spaces. I’m using a different module package and it’s all working just fine for me. PhpStorm will even update most of it for you when you move the files.
André Rodrigues
André RodriguesOP15mo ago
I moved the files and changed the namespaces but without success, I believe needs some configuration before.
Matthew
Matthew15mo ago
Hmm. Iirc, I did something like this about a week ago, and it worked fine.
DrByte
DrByte15mo ago
Are you getting any specific errors? It should be easy to deduce the required fixes based on the namespace errors you get.
André Rodrigues
André RodriguesOP15mo ago
I didn't implement it because I didn't find anything regarding this in the Filament documentation, the best I could imagine was creating a symbolic folder from my nwiart model to the App/Filement folder.
DrByte
DrByte15mo ago
You could create the necessary files using the provided Commands, and then move them to your nwidart modules folders. Just update the namespaces in the files. As awcodes said, PHPStorm will handle 80% of those name changes for you just by drag-and-drop. A few "use" statements in some file headers might need manual treatment. But even a find+replace would work.
André Rodrigues
André RodriguesOP15mo ago
If I understood yes I moved and changed the namespaces to
namespace Modules\Example\Filament\Resources;
namespace Modules\Example\Filament\Resources;
No description
André Rodrigues
André RodriguesOP15mo ago
But keep not showing in Dashboard the Customer resource option.
No description
cheesegrits
cheesegrits15mo ago
You probably need to change the resource discovery path in your panel provider, in app/Providers/Filament/AdminPanelProvider.php (or whatever).
André Rodrigues
André RodriguesOP15mo ago
I got it! Thanks a lot! 😄
Want results from more Discord servers?
Add your server