From 1122fa04834af1812ece07fe9d152ad521d055b0 Mon Sep 17 00:00:00 2001 From: Huynh Ba Thanh Date: Sat, 28 Jan 2017 17:18:12 +0700 Subject: [PATCH] Change share in Service Provider to singleton for Laravel 5.4 --- src/Vinelab/Cdn/CdnServiceProvider.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Vinelab/Cdn/CdnServiceProvider.php b/src/Vinelab/Cdn/CdnServiceProvider.php index 42d1ee9..5fc4dd2 100755 --- a/src/Vinelab/Cdn/CdnServiceProvider.php +++ b/src/Vinelab/Cdn/CdnServiceProvider.php @@ -91,24 +91,22 @@ public function register() // register the commands: //----------------------- - $this->app['cdn.push'] = $this->app->share(function () { - return $this->app->make('Vinelab\Cdn\Commands\PushCommand'); + $this->app->singleton('cdn.push', function ($app) { + return $app->make('Vinelab\Cdn\Commands\PushCommand'); }); - $this->commands('cdn.push'); - $this->app['cdn.empty'] = $this->app->share(function () { - return $this->app->make('Vinelab\Cdn\Commands\EmptyCommand'); + $this->app->singleton('cdn.empty', function ($app) { + return $app->make('Vinelab\Cdn\Commands\EmptyCommand'); }); - $this->commands('cdn.empty'); // facade bindings: //----------------- // Register 'CdnFacade' instance container to our CdnFacade object - $this->app['cdn'] = $this->app->share(function () { - return $this->app->make('Vinelab\Cdn\CdnFacade'); + $this->app->singleton('cdn', function ($app) { + return $app->make('Vinelab\Cdn\CdnFacade'); }); // Shortcut so developers don't need to add an Alias in app/config/app.php