nWidart / laravel-modules

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

Run artisan commands inside/for a module #1976

Open secrethash opened 4 days ago

secrethash commented 4 days ago

Summary

It would be great if we can run artisan commands inside an application module. I tried to find if this feature already exists, but couldn't find anywhere. If it does, please guide me so I can close this request.

What & Why

A lot of packages now a days have their own generate commands for example Laravel Verbs:

php artisan verbs:event CustomerBeganTrial

This makes it difficult to maintain the application as for each creation we need to move the files and update the namespaces. It would be great if we can just specify --module= flag and it runs for that specific module. I see that it is a feature in internachi/modular and also somewhat similar feature in stancl/tenancy

dcblogdev commented 3 days ago

Are you aware you can call module specific commands? ie php artisan module:make-controller MyAwesomeController Blog

would create a controller in a module called Blog.

I've seen the commands in modular it indeed that's cool. Not sure if that's something that can be supported with out structure. One to look into.