Laravel Modular
A package to generate modules for a Laravel project.
Requirements
- PHP 7.4 or greater
- Laravel version 8
Installation
Install using composer:
composer require dptsi/laravel-modular
Usage
-
(Optional) To change application namespace, run:
php artisan app:name Custom\Namespace
Note: All namespace inside app directory (app/) will change into custom namespace.
Note: in Mac OS or Linux use double backslash.
Custom\\Namespace
. -
To create a new module, run:
php artisan module:make ModuleName
By default this will create a new module using mvc skeleton and sqlsrv database configuration.
Note: the module name must be in StudlyCase
-
If you want to create a new module with a specific skeleton you can use
--skeleton
or-S
option. Supported skeletononion
andmvc
.php artisan module:make ModuleName --skeleton onion
php artisan module:make ModuleName -S onion
-
If you want to create a new modul using specific database you can use
--database
or-D
option. Supported databasesqlsrv
,mysql
andpgsql
.php artisan module:make ModuleName --database mysql
php artisan module:make ModuleName --D pgsql