Ray.Di for Laravel
English | Japanese
In addition to the existing Laravel service container, Ray.Di provides dependency resolution for contoroller. AOP can be applied to all injected objects.
Installation
composer require ray/ray-di-for-laravel
Use
Copy the module that describes the binding.
cp -r vendor/ray/ray-di-for-laravel/Ray app
Add the following line to bootstrap/app.php
.
use App\Ray\Module;
use App\RayRouter;
use Ray\Di\Injector;
$app['router'] = new RayRouter($app['events'], $app, new Injector(new Module()));
Demo
See hello-ray-di-for-laravel demo code.