]> BookStack Code Mirror - bookstack/blobdiff - app/Providers/CustomFacadeProvider.php
Skip intermediate login page with single provider
[bookstack] / app / Providers / CustomFacadeProvider.php
index bd4b2b515d47dbff9cad199fcc62b361caffb3b2..0518af44f9bf6e4f55d4ae311a30313aa7b8f1db 100644 (file)
@@ -2,10 +2,11 @@
 
 namespace BookStack\Providers;
 
-use BookStack\Services\ViewService;
+use BookStack\Actions\ActivityLogger;
+use BookStack\Auth\Permissions\PermissionService;
+use BookStack\Theming\ThemeService;
+use BookStack\Uploads\ImageService;
 use Illuminate\Support\ServiceProvider;
-use BookStack\Services\ActivityService;
-use BookStack\Services\SettingService;
 
 class CustomFacadeProvider extends ServiceProvider
 {
@@ -26,19 +27,20 @@ class CustomFacadeProvider extends ServiceProvider
      */
     public function register()
     {
-        $this->app->bind('activity', function() {
-            return new ActivityService($this->app->make('BookStack\Activity'));
+        $this->app->singleton('activity', function () {
+            return $this->app->make(ActivityLogger::class);
         });
 
-        $this->app->bind('views', function() {
-            return new ViewService($this->app->make('BookStack\View'));
+        $this->app->singleton('images', function () {
+            return $this->app->make(ImageService::class);
         });
 
-        $this->app->bind('setting', function() {
-            return new SettingService(
-                $this->app->make('BookStack\Setting'),
-                $this->app->make('Illuminate\Contracts\Cache\Repository')
-            );
+        $this->app->singleton('permissions', function () {
+            return $this->app->make(PermissionService::class);
+        });
+
+        $this->app->singleton('theme', function () {
+            return $this->app->make(ThemeService::class);
         });
     }
 }