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