Skip to content

Commit

Permalink
Merge pull request #110 from byhbt/features/fix-laravel-5-4-compatible
Browse files Browse the repository at this point in the history
Change share in Service Provider to singleton for Laravel 5.4
  • Loading branch information
Mulkave authored Jan 30, 2017
2 parents b57823a + 1122fa0 commit 4e42319
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Vinelab/Cdn/CdnServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e42319

Please sign in to comment.