nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.49k stars 952 forks source link

Sub-Modules #578

Closed imagina closed 6 years ago

imagina commented 6 years ago

We are creating an small e-commerce module for AsgardCms. Right now we are implementing the shipping, payment, modules, etc. like laravel-modules. But... all of this modules feels like would be better like sub-modules of our main ecommerce module.

What do you think @nWidart ? Any idea for this implementation.

Regards.

nWidart commented 6 years ago

Hello,

That thought crossed my mind before too 😄. I personally don't think having submodules is a good idea, architecture-wise.

I made an e-commerce with asgard recently too and considered your idea at the time. However, I preferred keeping all modules "one level" only, which makes it easier to re-use parts and not the whole. For instance, I had a cart module, an order module, a product module, an invoice module, etc. On another client, I could re-use some modules, but not others. Since all modules were fairly well decoupled it was easy to re-use the ones that matched the need for the second client.

In theory you can still do the submodules currently, but it won't be supported by the package, instead psr-4 will handle the autoloading for you.

nWidart commented 6 years ago

I'll close this as there hasn't been a reply in a while, feel free to comment if needed.