aiwozhe / laravel-modules
Laravel Module management
Requires
- php: ^8.3
- ext-dom: *
- ext-json: *
- ext-simplexml: *
- wikimedia/composer-merge-plugin: ^2.1
Requires (Dev)
- larastan/larastan: ^3.9.3
- laravel/framework: ^13.0
- laravel/pint: ^1.16
- mockery/mockery: ^1.6
- orchestra/testbench: ^11.0
- phpunit/phpunit: ^12.0
- spatie/phpunit-snapshot-assertions: ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master / 13.x-dev
- v13.2.0
- v13.1.0
- v13.0.0
- 12.x-dev
- v12.0.5
- v12.0.4
- v12.0.3
- v12.0.2
- v12.0.1
- v12.0.0
- v11.1.10
- v11.1.9
- v11.1.8
- v11.1.7
- v11.1.6
- v11.1.5
- v11.1.4
- v11.1.3
- v11.1.2
- v11.1.1
- v11.1.0
- v11.0.11
- v11.0.10
- v11.0.9
- v11.0.8
- v11.0.7
- v11.0.6
- v11.0.5
- 11.0.4
- v11.0.3
- v11.0.2
- v11.0.1
- v11.0.0
- 10.0.6
- 10.0.5
- 10.0.4
- 10.0.3
- 10.0.02
- 10.0.2
- 10.0.1
- v10.0.0
- v9.0.6
- 9.0.5
- v9.0.4
- v9.0.3
- v9.0.2
- 9.0.1
- v9.0.0
- 8.6.0
- v8.5.0
- v8.4.0
- v8.3.0
- 8.2.0
- 8.1.0
- 8.0.0
- 7.4.0
- 7.3.0
- 7.2.0
- 7.1.0
- 7.0.x-dev
- 7.0.0
- 6.2.0
- 6.1.0
- 6.0.x-dev
- 6.0.0
- 5.1.0
- 5.0.x-dev
- 5.0.1
- 5.0.0
- 4.1.0
- 4.0.x-dev
- 4.0.0
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.x-dev
- 3.0.1
- 3.0.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.x-dev
- 2.0.0
- 1.27.2
- 1.27.1
- 1.27.0
- 1.26.0
- 1.25.1
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.1
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.1
- 1.13.0
- 1.0.x-dev
- 0.12.0
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10
- 0.9
- 0.8
- 0.7
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2
- 0.1
- dev-feat/php83-idioms
- dev-feat/model-attributes
- dev-feat/make-config-job-middleware
- dev-feat/make-resource-json-api
This package is auto-updated.
Last update: 2026-10-27 18:26:32 UTC
README
What it does
- Splits a large Laravel app into modules that live in
Modules/. - Each module is a self-contained unit with its own service providers, routes, controllers, models, views, migrations, config and translations. It works like a small Laravel package inside your app.
- Modules can be enabled or disabled. Only enabled modules are booted. Status is stored by an activator (a JSON file by default).
- Artisan generators create modules and the classes inside them:
module:make,module:make-controller,module:make-model,module:make-migration, and more.
php artisan module:make Blog generates:
Modules/Blog/
├── app/ Http/Controllers, Providers
├── config/
├── database/ factories, migrations, seeders
├── resources/ assets, views
├── routes/ web.php, api.php
├── tests/ Feature, Unit
├── composer.json
├── module.json
├── package.json
└── vite.config.js
Requirements
PHP 8.3+ and Laravel 13 for the current version. See Versions for older Laravel releases.
Install
composer require nwidart/laravel-modules
The service provider and alias are registered automatically. To publish the config file (optional):
php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"
Autoloading
Module classes are autoloaded through wikimedia/composer-merge-plugin. Add this to the extra section of your app's composer.json:
"extra": { "laravel": { "dont-discover": [] }, "merge-plugin": { "include": [ "Modules/*/composer.json" ] } },
On first install, Composer asks:
Do you trust "wikimedia/composer-merge-plugin" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?]
Answer y. Or add it yourself:
"config": { "allow-plugins": { "wikimedia/composer-merge-plugin": true } }
If the plugin is set to false, modules are not autoloaded. After changing composer.json, run:
composer dump-autoload
Since v11.0, the
"Modules\\": "modules/"autoload entry is no longer needed. Remove it from yourcomposer.jsonif present.
Quick start
php artisan module:make Blog # create a module php artisan module:list # list modules and their status php artisan module:disable Blog # stop booting the module php artisan module:enable Blog # boot it again
Versions
| Laravel | laravel-modules |
|---|---|
| 13 | ^13.0 |
| 12 | ^12.0 |
| 11 | ^11.0 |
| 10 | ^10.0 |
Older Laravel versions use the matching major: 5.4 uses ^1.0, 5.5 uses ^2.0, through Laravel 9 with ^9.0.
Documentation
Full documentation: https://laravelmodules.com/docs.
Credits
Originally based on pingpong/modules, which is no longer maintained.
License
MIT. See LICENSE.md.
