3 namespace BookStack\App\Providers;
5 use BookStack\Theming\ThemeEvents;
6 use BookStack\Theming\ThemeService;
7 use Illuminate\Support\ServiceProvider;
9 class ThemeServiceProvider extends ServiceProvider
14 public function register(): void
16 // Register the ThemeService as a singleton
17 $this->app->singleton(ThemeService::class, fn ($app) => new ThemeService());
23 public function boot(): void
25 // Boot up the theme system
26 $themeService = $this->app->make(ThemeService::class);
27 $themeService->readThemeActions();
28 $themeService->dispatch(ThemeEvents::APP_BOOT, $this->app);