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