X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/80865b30a5d6a82e86d21e272ae58977d4430a64..refs/pull/1973/head:/app/Providers/CustomFacadeProvider.php diff --git a/app/Providers/CustomFacadeProvider.php b/app/Providers/CustomFacadeProvider.php index 9b290039c..b4158187c 100644 --- a/app/Providers/CustomFacadeProvider.php +++ b/app/Providers/CustomFacadeProvider.php @@ -2,11 +2,12 @@ namespace BookStack\Providers; -use BookStack\Services\ImageService; -use BookStack\Services\ViewService; +use BookStack\Actions\ActivityService; +use BookStack\Actions\ViewService; +use BookStack\Auth\Permissions\PermissionService; +use BookStack\Settings\SettingService; +use BookStack\Uploads\ImageService; use Illuminate\Support\ServiceProvider; -use BookStack\Services\ActivityService; -use BookStack\Services\SettingService; class CustomFacadeProvider extends ServiceProvider { @@ -27,33 +28,24 @@ class CustomFacadeProvider extends ServiceProvider */ public function register() { - $this->app->bind('activity', function() { - return new ActivityService( - $this->app->make('BookStack\Activity'), - $this->app->make('BookStack\Services\RestrictionService') - ); + $this->app->singleton('activity', function () { + return $this->app->make(ActivityService::class); }); - $this->app->bind('views', function() { - return new ViewService( - $this->app->make('BookStack\View'), - $this->app->make('BookStack\Services\RestrictionService') - ); + $this->app->singleton('views', function () { + return $this->app->make(ViewService::class); }); - $this->app->bind('setting', function() { - return new SettingService( - $this->app->make('BookStack\Setting'), - $this->app->make('Illuminate\Contracts\Cache\Repository') - ); + $this->app->singleton('setting', function () { + return $this->app->make(SettingService::class); }); - $this->app->bind('images', function() { - return new ImageService( - $this->app->make('Intervention\Image\ImageManager'), - $this->app->make('Illuminate\Contracts\Filesystem\Factory'), - $this->app->make('Illuminate\Contracts\Cache\Repository') - ); + $this->app->singleton('images', function () { + return $this->app->make(ImageService::class); + }); + + $this->app->singleton('permissions', function () { + return $this->app->make(PermissionService::class); }); } }