laravel-bridge/container is a Laravel package for the psr-11 container bridges.
It currently has 1 GitHub stars and 404 downloads on Packagist (latest version v1.1.0).
Install it with composer require laravel-bridge/container.
Discover more Laravel packages by laravel-bridge
or browse all Laravel packages to compare alternatives.
Last updated
The PSR-11 container bridges.
Build the wrapper.
// Laravel Container
$actualContainer = new \Illuminate\Container\Container();
$actualContainer->instance('foo', 'foo');
$wrapper = new \LaravelBridge\Container\Pimple\ContainerWrapper();
$wrapper->setContainer($actualContainer);
// Use like the Pimple Container, but it will register on Laravel Container
$wrapper['bar'] = function($c) {
return 'bar' . $c->get('foo');
};
$wrapper->get('bar'); // 'barfoo'
$actualContainer->make('bar'); // 'barfoo'
Use ServiceProvider bridge
// Laravel Container
$actualContainer = new \Illuminate\Container\Container();
$bridge = new \LaravelBridge\Container\Pimple\ServiceProviderBridge($actualContainer);
$bridge->register(new YourPimpleServiceProvider());
The MIT License (MIT). Please see License File for more information.