daltcore / laravel-share-fix
该包已被 废弃 并不再维护。没有推荐替代包。
恢复 Laravel 5.4 中的 share 方法
v1.0.0
2017-03-16 07:09 UTC
This package is auto-updated.
Last update: 2019-10-31 09:14:11 UTC
README
Laravel 5.4 兼容
将恢复 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
修改你的 bootstrap/app.php
$app = new Illuminate\Foundation\Application( realpath(__DIR__ . '/../') );
为
$app = new DALTCORE\ShareFix\Application( realpath(__DIR__ . '/../') );
现在你可以再次使用 $this->app->share
。