[] (https://insight.sensiolabs.com/projects/5134089a-8f55-42af-baf6-e9a57a76b1b4)
Lpackager is small package that allows you to generate packages/moduls to your laravel app without forgetting business logic. Split laravel app into pacakges/modules
-
Run composer require to install Lpackager :
composer require Amranidev/Lpackager:dev-master
Or add in composer.json:
require : { "laravel/framework": "5.2.*", "Amranidev/Lpackager": "v1.0.*" }
Then update composer :
$ composer update
-
Add the service providers to config/app.php :
Amranidev\Lpackager\LpackagerServiceProvider::class,
Create new package by php artisan lpackager:package <PackageName> <PackagePath> <"NameSpace">
In this example we will create a new (package/module) into our application with a name (Customer)
-
Create your first package:
php artisan lpackager:package Customer Kernel "Kernel\Customer"
![Imgur](http://i.imgur.com/iRR8pF6.png)
-
Register namespace:
Add to composer.json
"psr-4": { "App\\": "app/", "Kernel\\Customer\\": "Kernel/Customer/src" }
-
Register the service provider:
Add the service provider to config/app.php
Kernel\Customer\CustomerServiceProvider::class,
-
Finally:
Run
composer dump-autoload
Check if evreything is okey :
http://{your-project-url}/Client
-
Create new Package :
php artisan lpackager:package <PackageName> <PackagePath> <"NameSpace">
-
Create new Controller :
php artisan lpackager:controller <Class> <PackageName> <PackagePath> <"NameSpace">
-
Create new Model :
php artisan lpackager:model <Class> <PackagePath> <"NameSpace">