]> BookStack Code Mirror - bookstack/blob - app/Providers/CustomFacadeProvider.php
Show users link in top nav if user is signed in and only manages users
[bookstack] / app / Providers / CustomFacadeProvider.php
1 <?php
2
3 namespace BookStack\Providers;
4
5 use BookStack\Actions\Activity;
6 use BookStack\Actions\ActivityService;
7 use BookStack\Actions\View;
8 use BookStack\Actions\ViewService;
9 use BookStack\Auth\Permissions\PermissionService;
10 use BookStack\Settings\Setting;
11 use BookStack\Settings\SettingService;
12 use BookStack\Uploads\Image;
13 use BookStack\Uploads\ImageService;
14 use Illuminate\Contracts\Cache\Repository;
15 use Illuminate\Contracts\Filesystem\Factory;
16 use Illuminate\Support\ServiceProvider;
17 use Intervention\Image\ImageManager;
18
19 class CustomFacadeProvider extends ServiceProvider
20 {
21     /**
22      * Bootstrap the application services.
23      *
24      * @return void
25      */
26     public function boot()
27     {
28         //
29     }
30
31     /**
32      * Register the application services.
33      *
34      * @return void
35      */
36     public function register()
37     {
38         $this->app->bind('activity', function () {
39             return new ActivityService(
40                 $this->app->make(Activity::class),
41                 $this->app->make(PermissionService::class)
42             );
43         });
44
45         $this->app->bind('views', function () {
46             return new ViewService(
47                 $this->app->make(View::class),
48                 $this->app->make(PermissionService::class)
49             );
50         });
51
52         $this->app->bind('setting', function () {
53             return new SettingService(
54                 $this->app->make(Setting::class),
55                 $this->app->make(Repository::class)
56             );
57         });
58
59         $this->app->bind('images', function () {
60             return new ImageService(
61                 $this->app->make(Image::class),
62                 $this->app->make(ImageManager::class),
63                 $this->app->make(Factory::class),
64                 $this->app->make(Repository::class)
65             );
66         });
67     }
68 }