Download the PHP package vheins/laravel-module-generator without Composer
On this page you can find all versions of the php package vheins/laravel-module-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vheins/laravel-module-generator
More information about vheins/laravel-module-generator
Files in vheins/laravel-module-generator
Package laravel-module-generator
Short Description Generate Laravel Modules from a template.
License
Informations about the package laravel-module-generator
Laravel Module Generator
Generate Laravel modules from opinionated templates — scaffold models, migrations, factories, seeders, requests, actions, controllers, Vue components/pages/stores, permissions, and full blueprint-driven module trees in seconds.
Built on top of nwidart/laravel-modules (^v10.0 || ^v11.0 || ^v12.0 || ^v13.0). Extends its module:make workflow with 19 additional create:* artisan commands and a stubs/modular template layer that also wires routes, dashboard links, and API resources automatically.
Table of Contents
- Requirements
- Installation
- Configuration
- Publishing Stubs
- Usage
- Blueprint-Driven Generation
- Sub-Module Scaffold
- Model, Migration, Factory, Seeder, Request, Action
- Controller
- Vue Components, Pages & Stores
- Permissions & API CRUD (non-modular)
- All 19 Commands Reference
- Stub Customization
- Testing
- Changelog
- Security
- Contributing
- License
- Credits
Requirements
| Dependency | Constraint | Notes |
|---|---|---|
| PHP | ^8.2 \|\| ^8.3 \|\| ^8.4 |
As declared in composer.json |
| Laravel Framework | ^11.0 \|\| ^12.0 \|\| ^13.0 |
Includes Laravel 13 support |
nwidart/laravel-modules |
^v10.0 \|\| ^v11.0 \|\| ^v12.0 \|\| ^v13.0 |
|
lorisleiva/laravel-actions |
^v2.7.1 |
|
symfony/yaml |
^7.4 \|\| ^8.0 |
For .blueprint YAML parsing |
Supported matrix verified by
tests/Unit/Compatibility/Laravel13CompatibilityTest.php(17 compatibility contract tests covering version constraints, provider registration, and stub API surface).
Installation
Install via Composer (package name is vheins/laravel-module-generator — see composer.json):
The service provider Vheins\LaravelModuleGenerator\Providers\LaravelModuleGeneratorServiceProvider is auto-discovered via extra.laravel.providers in composer.json — no manual registration required.
If auto-discovery is disabled, register it manually in config/app.php:
Configuration
The package ships two config files:
laravel-module-generator.php— package-specific settings (name => 'LaravelModuleGenerator').modules.php— fullnwidart/laravel-modulesconfiguration (namespace, stubs, paths, generators, activators, etc.).
Publish them with:
This copies laravel-module-generator.php to config/laravel-module-generator.php and modules.php to config/modules.php.
Key modules.php settings to be aware of:
namespacedefaults toVheins— change to your organization namespace.stubs.pathdefaults tobase_path('stubs/modular')— see Stub Customization.paths.modulesdefaults tobase_path('modules')— generated modules land here.composer.vendordefaults tovheinsandcomposer.authortoMuhammad Rheza Alfin— update for your own scaffolds.
Publishing Stubs
Publish the full stub tree to base_path('stubs') for local customization:
Stubs published include:
- Top-level stubs (
stubs/*.stub) — controllers, models, factories, migrations, actions, etc. - Modular stubs (
stubs/modular/**) — Vue components (component.filter,component.form.*,component.link,icontab), Vue pages (page.create,page.index,page.[id]),store.pinia, migrations, routes, scaffold config, etc.
Edit any published stub in place; subsequent generator runs will use your modified version.
Usage
All commands are registered by LaravelModuleGeneratorServiceProvider::COMMANDS (the canonical 19-command inventory) and are available only when runningInConsole() or runningUnitTests().
Blueprint-Driven Generation
Generate an entire module tree from a YAML blueprint file placed in .blueprint/:
The command reads .blueprint/{file} via symfony/yaml, iterates module → subModule → tables, and for each entry:
- calls
create:module:sub(withfillableanddb-onlyderived fromFillable/CRUDkeys), - runs
CreateRelationwhenRelationis present, - runs
CreateQuerywhenQuery: trueand collects query slugs forFixQueryApi.
Blueprint shape (keys are case-sensitive as parsed):
Ends with optimize:clear.
Sub-Module Scaffold
The heavy lifter — creates a complete sub-module inside a parent module (creates the parent via module:make --api if it does not exist):
module(required) — parent module name (StudlyCase).name(required) — sub-module / entity name.--fillable— comma-separatedfield:typepairs (e.g.,title:string,amount:decimal).--db-only— when present, skips Vue components, controllers, requests, actions, routes, dashboard links, and store/pages.
When not --db-only, also generates Vue tab/link components, model + migration + factory + seeder, API controller, request, Store/Update/Delete actions, API route, dashboard link/tab entries, and Vue store + pages + form + filter, then runs optimize:clear.
Model, Migration, Factory, Seeder, Request, Action
Controller
Vue Components, Pages & Stores
All Vue generators accept {name} {module?} [--fillable=] where name may be a compound like InvoiceProduct:
Generated paths (relative to modules/{Module}/):
- Components →
Vue/components/ - Pages →
Vue/pages/ - Stores →
Vue/store/(orvue/storespermodules.phpgenerator config)
Permissions & API CRUD (non-modular)
These two commands operate on the host application (not inside modules/):
All 19 Commands Reference
| # | Command | Class | Arguments | Options |
|---|---|---|---|---|
| 1 | create:module |
CreateModule |
— | --blueprint= (required file under .blueprint/) |
| 2 | create:module:sub |
CreateModuleSub |
module (required), name (required) |
--fillable= field:type,…, --db-only |
| 3 | create:module:model |
CreateModuleModel |
model (required), module (optional) |
--fillable= --migration -m --controller -c --seed -s --request -r |
| 4 | create:module:controller |
CreateModuleController |
controller (required), module (optional) |
--plain -p, --api |
| 5 | create:module:migration |
CreateModuleMigration |
basename (required), name (required), module (optional) |
--fields= --plain |
| 6 | create:module:factory |
CreateModuleFactory |
name (required), module (required) |
--fillable= |
| 7 | create:module:seeder |
CreateModuleSeeder |
name (required), module (optional) |
--master |
| 8 | create:module:request |
CreateModuleRequest |
name (required), module (optional) |
--fillable= |
| 9 | create:module:action |
CreateModuleAction |
name (required), module (optional) |
— |
| 10 | create:module:vue:component:tab |
CreateModuleVueComponentTab |
name (required), module (optional) |
--fillable= |
| 11 | create:module:vue:component:link |
CreateModuleVueComponentLink |
name (required), module (optional) |
--fillable= |
| 12 | create:module:vue:component:form |
CreateModuleVueComponentForm |
name (required), module (optional) |
--fillable= |
| 13 | create:module:vue:component:filter |
CreateModuleVueComponentFilter |
name (required), module (optional) |
--fillable= |
| 14 | create:module:vue:page:index |
CreateModuleVuePageIndex |
name (required), module (optional) |
--fillable= |
| 15 | create:module:vue:page:new |
CreateModuleVuePageCreate |
name (required), module (optional) |
--fillable= |
| 16 | create:module:vue:page:view |
CreateModuleVuePageView |
name (required), module (optional) |
--fillable= |
| 17 | create:module:vue:store |
CreateModuleVueStore |
name (required), module (optional) |
--fillable= |
| 18 | create:permission |
CreatePermission |
name (required) |
— |
| 19 | create:api:crud |
CreateApiCrud |
name (required) |
--action |
Command list verified against
Providers/LaravelModuleGeneratorServiceProvider.php::COMMANDSand individualConsole/*.phpsignatures. FileCreateModuleVuePageCreateregisters ascreate:module:vue:page:new(notcreate).
Stub Customization
After publishing stubs:
- Edit any file under
stubs/orstubs/modular/— the generators resolve stubs throughNwidart\Modules\Support\Stub, which prefers published paths. modules.phpkeystubs.replacementscontrols token replacements (LOWER_NAME,STUDLY_NAME,MODULE_NAMESPACE, etc.).- Generator destinations are controlled by
modules.php→paths.generator.*(model → Models,controller → Controllers,factory → database/factories,vue → vue,vue-components → Vue/components, etc.). - Set a generator's
generateflag tofalseto skip that path entirely.
Testing
--no-coverage is required because phpunit.xml.dist sets failOnWarning="true" — the coverage text reporter emits a warning when no coverage driver is present, which would otherwise fail the run. CI uses the same flag.
Test suite layout:
tests/Unit/Compatibility/Laravel13CompatibilityTest.php— 17 tests: version-constraint matrix, provider/command registration, stub API guards.tests/Unit/Console/*Test.php— per-command generation tests (one file per command class).tests/TestCase.php+testbench.yaml— Orchestra Testbench harness (SQLite in-memory,APP_KEYis a testing-only dummy).
Additional tooling:
Changelog
See Semantic Versioning.
Security
If you discover a security vulnerability, please follow the process in SECURITY.md — do not open a public issue.
Contributing
Contributions are welcome. Please read Code of Conduct before opening a PR.
Quick start:
License
MIT — see LICENSE.
Credits
- Original author: Muhammad Rheza Alfin (
composer.jsonauthor field). - Maintained by Vheins.
- Built on nwidart/laravel-modules and lorisleiva/laravel-actions.
All versions of laravel-module-generator with dependencies
laravel/framework Version ^11.0 || ^12.0 || ^13.0
lorisleiva/laravel-actions Version ^v2.7.1
symfony/yaml Version ^7.4 || ^8.0
nwidart/laravel-modules Version ^v10.0 || ^v11.0 || ^v12.0 || ^v13.0