app->singleton(TenantContext::class); $this->app->singleton(TenantConfig::class); } /** * Bootstrap any application services. */ public function boot(): void { // Operating data of the landlord (addresses, periods) and test mode (every e-mail goes to the test // recipient only, until switched live). Console and boot know the landlord only if there is exactly one. try { $this->app->make(TenantConfig::class)->refresh(); } catch (Throwable) { // no database yet (package discovery, first install) } // Photos: remove metadata (GPS position, camera data) from uploaded originals, which stay downloadable. Event::listen(MediaHasBeenAddedEvent::class, fn (MediaHasBeenAddedEvent $event) => StripImageMetadata::strip($event->media)); // On Strato the domain points at the deployment folder and .htaccess forwards to current/public; // without a fixed root, some URLs (e.g. /sitemap.xml) would be generated with /current/public. if (! $this->app->environment('local', 'testing')) { URL::forceRootUrl(config('app.url')); URL::forceScheme(parse_url((string) config('app.url'), PHP_URL_SCHEME) ?: 'https'); } } }