$portalValues Eigenes Portal plus `both`. * @param array $domainConfig */ private function __construct( public readonly string $domainKey, public readonly Portal $portal, public readonly string $language, public readonly array $portalValues, public readonly array $domainConfig, ) {} /** * Portal-Ableitung ohne Seiteneffekte (kein Anwenden der Domain-Config) — * für Komponenten, die nur wissen müssen, auf welchem Portal sie rendern. */ public static function portalFromHost(): Portal { return str_contains(request()->getHost(), 'presseecho') ? Portal::Presseecho : Portal::Businessportal24; } public static function fromRequest(): self { $portal = self::portalFromHost(); $domainKey = $portal === Portal::Presseecho ? 'presseecho' : 'businessportal24'; return new self( domainKey: $domainKey, portal: $portal, language: app()->getLocale(), portalValues: [$portal->value, Portal::Both->value], domainConfig: DomainAssetContext::applyWebDomainConfig($domainKey), ); } }