Hello again,
Is it possible to organize modules within sub folders?
Ex .: Stock/Products
I ran the command: "php artisan module:make Stock/Products"
All folders have been created, but the controller is not created and an error occurs after php artisan is executed.
Error:
聽 [Nwidart \ Modules \ Exceptions \ ModuleNotFoundException]
聽聽 Module [Stock/Products] does not exist!
I do not know if it would be possible and would be correct to create subfolders to better organize the application.
Grateful
Hello,
This is not possible. However, you can add a dependency to your Product module. You can do that using the usual composer way of handling dependencies, via the composer.json file.
Thanks for the answer.
As a beginner, could you give a practical example (code) about what you cited?
if you look at your module, you have a composer.json file inside there.
In the require key of that file, you can add you module. Prior to this your module will have to be registered on packagist (or private equivalent like toranproxy/satis/..).
There is also a command php artisan module:update Product which will add those dependencies of the product module, onto your main composer.json file, the one on the root of your project.
Hello,
I run into this issue for a while, so I just set the "scan.enabled" property to true (in modules.php config file), and added paths where submodules lives.
But when I need to generate a new subModule, I first change the "modules" property to the "subModule parent" path, and I also change the "namespace".
and everything worked fine
I think this wouldn't be such a bad feature. I just tried the same and hoped to archive some structure like:
Modules/Endpoint/Products
Modules/Endpoint/Orders
Modules/GUI/Products
Modules/GUI/Orders
Most helpful comment
I think this wouldn't be such a bad feature. I just tried the same and hoped to archive some structure like: