rajubepary / laravel-module
This is my package laravel-module
Fund package maintenance!
Requires
- php: ^8.2.0
- illuminate/contracts: ^11.0||^12.0||^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.0.0||^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
This package is auto-updated.
Last update: 2026-08-18 18:23:49 UTC
README
A powerful and flexible modular architecture package for Laravel applications. This package allows you to seamlessly create, manage, and organize your Laravel application into modular components.
Installation
You can install the package via composer:
composer require rajubepary/laravel-module
After installing the package, run the setup command. This will publish the configuration file and run the necessary migrations:
php artisan lm:setup
If you prefer to do this manually, you can publish the config file and run migrations:
php artisan vendor:publish --tag="module-config"
php artisan migrate
Available Commands
The package provides several Artisan commands to manage your modules. By default, they are prefixed with lm: (you can change this in the laravel-module.php config).
Scaffolding
- Create a Module: Generate a new module skeleton.
php artisan lm:module:make {slug}(Example:php artisan lm:module:make customerswill create aCustomersmodule with controllers, views, config, and routes).
Management
- List Modules: View all discovered modules and their statuses.
php artisan lm:module:list
- Install a Module: Install a specific module.
php artisan lm:module:install {slug} - Activate a Module: Enable an installed module.
php artisan lm:module:activate {slug} - Deactivate a Module: Disable an active module.
php artisan lm:module:deactivate {slug} - Uninstall a Module: Remove a module entirely.
php artisan lm:module:uninstall {slug}
Usage
When you create a module, a structured directory is created in app/Modules (or your configured path) with a module.json manifest, a service provider, controllers, routes, and views.
Active modules are automatically discovered and loaded into your Laravel application, registering their routes, views, and navigation menus.
You can customize the module path, navigation settings, and more in the published config/laravel-module.php file.
Hooks & Filters
The package includes a built-in WordPress-style hook system to let modules interact without tight coupling.
You can use add_action, do_action, add_filter, and apply_filters inside your modules.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.