3 namespace BookStack\App\Providers;
5 use BookStack\Theming\ThemeEvents;
6 use BookStack\Theming\ThemeService;
7 use Illuminate\Support\Facades\Route;
8 use Illuminate\Support\ServiceProvider;
10 class ThemeServiceProvider extends ServiceProvider
17 public function register()
19 // Register the ThemeService as a singleton
20 $this->app->singleton(ThemeService::class, fn ($app) => new ThemeService());
28 public function boot()
30 // Boot up the theme system
31 $themeService = $this->app->make(ThemeService::class);
32 $themeService->readThemeActions();
33 $themeService->dispatch(ThemeEvents::APP_BOOT, $this->app);