daltcore / laravel-share-fix
Get back the share method in Laravel 5.4
Installs: 1 155
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2019-10-31 09:14:11 UTC
README
Laravel 5.4 compatible
Will give back the functionality thats taken out in 5.4:
share Method Removed
The share method has been removed from the container. This was a legacy method that has not been documented in several years. If you are using this method, you should begin using the singleton method instead:
$container->singleton('foo', function () {
return 'foo';
});
composer require daltcore/laravel-share-fix dev-master
Change in your bootstrap/app.php
$app = new Illuminate\Foundation\Application( realpath(__DIR__ . '/../') );
to
$app = new DALTCORE\ShareFix\Application( realpath(__DIR__ . '/../') );
Now you can use $this->app->share
again.