- How do I install dcblogdev/laravel-module-generator?
- Install it as a dev dependency with Composer using composer require --dev dcblogdev/laravel-module-generator and pin it to ^2.0. No production service provider wiring is required, so it stays out of your runtime request path. Check the README for the exact Artisan command signature before generating your first module.
- What Laravel versions does laravel-module-generator support?
- Version 2.0.7 adds Laravel 13.x compatibility, and earlier 2.x releases target prior Laravel majors. Before upgrading your application framework, confirm the package's composer.json constraint matrix to see whether support is widened to Laravel 10, 11, 12 and 13 or narrowed to 13.x only. Sequence the Laravel upgrade and generator upgrade in the same change window, not weeks apart.
- What files does the Laravel module generator scaffold?
- The generator scaffolds controllers, models, migrations, routes and views into a clean, self-contained module structure. It is designed to speed up feature development by emitting conventional boilerplate from a naming convention. Once committed, those files are ordinary application code that your team owns and edits.
- Is laravel-module-generator safe to use in production?
- It is a dev-time scaffolding package, not a runtime dependency, so it has no production request-path footprint, no runtime migrations and no config to keep in sync. The main risk is generated output drift, where stub templates no longer match your project's current idioms. Review generated diffs before committing and treat the generator as a productivity tool rather than an application dependency.
- How do I generate a module with the Artisan command?
- The package exposes an Artisan command that generates a module from a module name. Run that command with your chosen name and it writes the controller, model, migration, route and view boilerplate into the module directory. Use the README for the exact command signature and available options, then review the emitted files before committing.
- Do I need to configure or publish config files for this package?
- You do not need production service provider wiring or config publishing obligations to use the generator. Install it with require-dev, run the Artisan command and commit the generated files. If the package offers optional publishing for stubs or config, check the README and only publish when your team needs to customize defaults.
- Can I customize the generated stubs to match my team's conventions?
- Generated code comes from stub templates, so customization matters if your codebase uses attribute-based Eloquent casts, invokable controllers, Pest test stubs or non-standard namespacing. Check whether the package lets you publish or override stubs; if not, expect to hand-edit output heavily. A good acceptance test is to generate one low-risk module and diff it against what a developer would have written by hand.
- How does it compare to nwidart/laravel-modules?
- dcblogdev/laravel-module-generator is a lightweight dev-time boilerplate generator, while nwidart/laravel-modules is a common alternative when you need a fuller module system with runtime module management. If you only need scaffolded controllers, models, migrations, routes and views, the lighter generator may be sufficient. If you need module loading and lifecycle tooling at runtime, evaluate a dedicated module system instead.
- Will generated modules break when I upgrade Laravel?
- Generated modules become ordinary application code the moment they are committed, so a Laravel upgrade will not automatically modernize them. A new compatibility release such as v2.0.7 may update stub templates to match Laravel 13 conventions, which can make output generated before and after the bump stylistically inconsistent. Regenerate one reference module after upgrading and review the diff for stub-convention changes.
- How do I test generated modules and keep them maintainable?
- Treat generated modules like hand-written application code: add feature and unit tests, run them in CI, and review generated diffs as part of code review. Start with a single low-risk module and use the diff against a hand-written version as your acceptance test. Budget periodic review of generated modules as Laravel idioms evolve, because the generator will not retroactively modernize committed code.