]> BookStack Code Mirror - bookstack/blob - app/Providers/ThemeServiceProvider.php
Added method for using enity ownership in relation queries
[bookstack] / app / Providers / ThemeServiceProvider.php
1 <?php
2
3 namespace BookStack\Providers;
4
5 use BookStack\Theming\ThemeEvents;
6 use BookStack\Theming\ThemeService;
7 use Illuminate\Support\ServiceProvider;
8
9 class ThemeServiceProvider extends ServiceProvider
10 {
11     /**
12      * Register services.
13      *
14      * @return void
15      */
16     public function register()
17     {
18         // Register the ThemeService as a singleton
19         $this->app->singleton(ThemeService::class, fn ($app) => new ThemeService());
20     }
21
22     /**
23      * Bootstrap services.
24      *
25      * @return void
26      */
27     public function boot()
28     {
29         // Boot up the theme system
30         $themeService = $this->app->make(ThemeService::class);
31         $themeService->readThemeActions();
32         $themeService->dispatch(ThemeEvents::APP_BOOT, $this->app);
33     }
34 }