rits / modular
Modular structure for laravel projects.
1.0.0
2017-05-31 16:03 UTC
Requires
- php: ^7.0
- laravel/framework: ~5.1
Requires (Dev)
- codeclimate/php-test-reporter: ^0.4.4
- friendsofphp/php-cs-fixer: 1.*
- mockery/mockery: ^0.9.9
- phpunit/phpunit: ^6.1
- pragmarx/laravelcs: ^0.1.0
- satooshi/php-coveralls: ^1.0
This package is auto-updated.
Last update: 2024-11-08 10:28:32 UTC
README
Offers a easy way to modularize your laravel app.
Installation
Require this package with composer:
composer require rits/modular
After updating composer, add the ModularServiceProvider to the providers array in config/app.php. Use vendor:publish command to create the configuration file.
php artisan vendor:publish --tag=rits/modular
Usage
You can choose wherever you want to store your modules. In most cases app/Modules is a good choice. Create a class that extends the ModuleDefinition class, and add the class name in the modular.php config file.
Example:
- Create the app/Modules/Frontend/Module.php file;
- Create the class with the correct namespace and extend Rits\Modular\ModuleDefinition;
- Add App\Modules\Frontend\Module::class to the available array in the modular.php config file.
Restrictions
All module's controllers must be in a Controllers folder in the module main directory.
Roadmap
- Create a command to easily create a new module;
- Rewrite the README.md with better examples;
- Provide a example repository.