dot-env-it / laravel-module-boilerplate
A streamlined boilerplate generator for modular Laravel architectures.
Package info
github.com/dot-env-it/laravel-module-boilerplate
pkg:composer/dot-env-it/laravel-module-boilerplate
Requires
- php: ^8.2
- illuminate/support: ^9.0|^10.0|^11.0|^12.0|^13.0
This package is auto-updated.
Last update: 2026-04-26 09:21:39 UTC
README
A high-performance modular architecture generator designed for Laravel. This package allows you to quickly scaffold entire modules (Controllers, Models, Services, etc.) within a modules/ directory.
π Installation
This package is intended for local development only. Do not install it in production.
1. Require the Package
Install via Composer using the --dev flag:
composer require dot-env-it/laravel-module-boilerplate --dev
2. Publish Stubs (Optional)
If you wish to customize the templates used for generation, publish the stubs to your project root:
php artisan vendor:publish --tag=module-boilerplate-stubs
The stubs will be available in stubs/vendor/dot-env-it/.
π Usage
Generate a Full Module
To scaffold a complete module structure:
php artisan module:make Blog
Custom JS Path
If you use a non-standard directory for your frontend assets:
php artisan module:make Blog --js-path=Assets/scripts
Available Sub-Commands
You can also generate individual components within a module:
php artisan module:controller {name} --module={module}php artisan module:model {name} --module={module}php artisan module:service {name} --module={module}php artisan module:request {name} --module={module}- (And 14+ other specialized commands)
π Module Structure
Generated modules follow this clean architecture:
app/
βββModules/
β βββ Blog/
β βββ Actions/
β βββ DataTables/
β βββ Http/
β β βββ Controllers/
β β βββ Payloads/
β β βββ Requests/
β β βββ Resources/
β βββ Models/
β βββ Queries/
β βββ Services/
βββresources/
βββcustom-js-path/modules/blog
βββviews/modules/blog
It also creates permissions if spatie/laravel-permission package is installed.
π‘ Security & Environment
This package automatically disables its commands when APP_ENV is set to production. This ensures that your file system remain protected in live environments.
π₯ Credits
- dot-env-it (dotenvit@gmail.com)
π License
The MIT License (MIT). Please see License File for more information.