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