rp76 / module
this package will help anyone who want to make a modular laravel project.
README
rp76/module
is a Laravel package that allows you to split your large project to pieces to managing them easier and use them many times to another project.
This package allows you to have many Routes, Models, Controllers, Migrations and Views without conflict on team project. Also, each module has special composer for itself.
Install
To install through Composer, by run the following command:
composer require rp76/module
You can add the package to your project by entering the following command
// config/app.php
'providers' => [
...
\Rp76\Module\ModuleServiceProvider::class,
],
then publish the package's configuration file by running:
php artisan vendor:publish --tag=RpModule
or
php artisan vendor:publish --provider="Rp76\Module\ModuleServiceProvider"
or any ways you know.
after you published that, you have to add this command to.
// config/app.php
'providers' => [
...
\App\Providers\ModulesProvider::class,
],
Tip: new modules don't need any composer install or dumpāautoload
Documentation
It's a simple package, we have few command to make new files.
Start Module
php artisan module:install
This command makes modules folder in your root folder of project with template module.
It's necessary to use once.
Make New Module
php artisan module:make {name} //php artisan module:make Book
Tip: You must add your module name to config/RpModule.php
Make New Controller
php artisan module:controller {name} {moduleName} --r //php artisan module:controller BookController Book
Tip:
- Some parameters are optional like --r.
- --r parameter helps you to make resource controller.
Make New Model
php artisan module:model {name} {moduleName} --m //php artisan module:model Book Book
Tip:
- Some parameters are optional like --m.
- --m parameter helps you to make migration and model.
Make New Migration
php artisan module:migration {name} {moduleName} //php artisan module:migration create_book Book
License
The MIT License (MIT). Please see License File for more information.