hostname => Zweck ('public' | 'console') */ public static function all(): array { $found = []; foreach ((array) config('admin_access.site_hosts', []) as $host) { self::add($found, $host, 'public'); } foreach ([ 'admin_access.app_host', 'admin_access.status_host', 'admin_access.files_host', ] as $key) { self::add($found, (string) config($key, ''), 'public'); } // Die Konsole und ihre Ausweichnamen. `console`, weil sie hinter der // Netzsperre liegen — ein Name mit dem falschen Zweck sähe hier aus wie // eine funktionierende Seite und wäre eine offene Konsole. foreach ((array) config('admin_access.hosts', []) as $host) { self::add($found, $host, 'console'); } ksort($found); return $found; } private static function add(array &$found, string $host, string $purpose): void { $host = strtolower(trim($host)); // Kein Schema, kein Pfad, kein Port — und mindestens ein Punkt. Ein // blanker Name wie `localhost` ist ein Entwicklungsrest und hat kein // Zertifikat, das jemand überwachen wollte. if ($host === '' || ! str_contains($host, '.') || preg_match('/[^a-z0-9.\-]/', $host)) { return; } // Konsole gewinnt gegen öffentlich, wenn ein Name in beiden Listen // steht: die engere Aussage ist die richtige. if (($found[$host] ?? null) !== 'console') { $found[$host] = $purpose; } } }