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
Vp10mo ago
You can change like this protected static ?string $slug = 'custom-url-slug';
André Rodrigues
André Rodrigues10mo ago
Not the url, but the path where is created, it's where the Filement see the php classes.
Vp
Vp10mo ago
Oh sorry didn't read properly, and I don't have any idea then.. sorry 😅
awcodes
awcodes10mo 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é Rodrigues10mo ago
I moved the files and changed the namespaces but without success, I believe needs some configuration before.
Matthew
Matthew10mo ago
Hmm. Iirc, I did something like this about a week ago, and it worked fine.
DrByte
DrByte10mo 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é Rodrigues10mo 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
DrByte10mo 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é Rodrigues10mo 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é Rodrigues10mo ago
But keep not showing in Dashboard the Customer resource option.
No description
cheesegrits
cheesegrits10mo 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é Rodrigues10mo ago
I got it! Thanks a lot! 😄