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
You can change like this
protected static ?string $slug = 'custom-url-slug';
Not the url, but the path where is created, it's where the Filement see the php classes.
Oh sorry didn't read properly, and I don't have any idea then.. sorry 😅
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.
I moved the files and changed the namespaces but without success, I believe needs some configuration before.
Hmm. Iirc, I did something like this about a week ago, and it worked fine.
Are you getting any specific errors? It should be easy to deduce the required fixes based on the namespace errors you get.
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.
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.
If I understood yes I moved and changed the namespaces to
But keep not showing in Dashboard the Customer resource option.
You probably need to change the resource discovery path in your panel provider, in app/Providers/Filament/AdminPanelProvider.php (or whatever).
I got it! Thanks a lot! 😄