Files
fewo-stommer/app/Providers/AppServiceProvider.php
T
LarsandClaude Opus 5.5 7e22e12cac U-A/U-B: Prozesskern mit Fachmodulen, versionierten Modellen, eingefrorenem Prozessplan, ProcessRunner (harte/weiche Abhängigkeiten), CasePricing, Loyalty nur im Tester
CaseActivities/CaseAutomation sind Fassaden über ProcessRunner. Verhaltensvergleich v0.11:
11 Abläufe und 198 Konstellationen gleich, beabsichtigte Abweichungen I-004/I-005 (F-001/F-002).
Volle Suite vor U-B: 785/785.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 14:49:44 +01:00

55 lines
2.0 KiB
PHP

<?php
namespace App\Providers;
use App\Process\ProcessCatalogue;
use App\Support\StripImageMetadata;
use App\Support\SystemSettings;
use App\Tenancy\TenantConfig;
use App\Tenancy\TenantContext;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Spatie\MediaLibrary\MediaCollections\Events\MediaHasBeenAddedEvent;
use Throwable;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->singleton(TenantContext::class);
$this->app->singleton(TenantConfig::class);
$this->app->singleton(ProcessCatalogue::class);
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Settings of the installation first (they become the baseline a landlord may tighten), then the
// operating data of the landlord: addresses, periods and test mode, which sends every e-mail to the
// test recipient only until a landlord is switched live. Console and boot know the landlord only if
// there is exactly one.
try {
SystemSettings::apply();
$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');
}
}
}