iurylippo / lumen-modules
Lumen Module management
Requires
- php: ^7.2.5
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- laravel/framework: ^7.0
- mockery/mockery: ~1.0
- orchestra/testbench: ^5.0
- phpstan/phpstan: ^0.12.14
- phpunit/phpunit: ^8.5
- spatie/phpunit-snapshot-assertions: ^2.1.0
This package is auto-updated.
Last update: 2025-01-29 06:30:05 UTC
README
| 7.0 | ^7.0 |
iurylippo/lumen-modules
lumen package to generate modules with controllers, providers, services, repositories,
entities and tests in a Dependency Injected way.
Install
To install through Composer, by run the following command:
composer require iurylippo/lumen-modules
Autoloading
By default the module classes are not loaded automatically. You can autoload your modules using psr-4
. For example:
{ "autoload": { "psr-4": { "App\\": "app/", "Modules\\": "Modules/" } } }
Tip: don't forget to run composer dump-autoload
afterwards.
Lumen doesn't come with a vendor publisher. In order to use laravel-modules with lumen you have to set it up manually.
Create a config folder inside the root directory and copy vendor/nwidart/laravel-modules/config/config.php
to that folder named modules.php
mkdir config cp vendor/nwidart/laravel-modules/config/config.php config/modules.php
Then load the config and the service provider inbootstrap/app.php
$app->configure('modules'); $app->register(\Nwidart\Modules\LumenModulesServiceProvider::class);
Laravel-modules uses path.public which isn't defined by default in Lumen. Register path.public before loading the service provider.
$app->bind('path.public', function() { return __DIR__ . 'public/'; });
Tip: Put this path bind above the $app.
Documentation
You'll find installation instructions and full documentation on https://nwidart.com/laravel-modules/. THE ORIGINAL PACKAGE FOR LARAVEL
Credits
About Nicolas Widart
Nicolas Widart is a freelance web developer specialising on the Laravel framework. View all the packages on my website, or visit my website.
License
The MIT License (MIT). Please see License File for more information.