config('coruna.panel.admin_hosts', []), 'agent' => config('coruna.panel.agent_hosts', []), default => [], }; if (! is_array($hosts) || $hosts === []) { return $next($request); } $allowed = array_values(array_filter(array_map( static fn ($h) => strtolower(trim((string) $h)), $hosts ))); if ($allowed === []) { return $next($request); } $host = strtolower($request->getHost()); if (! in_array($host, $allowed, true)) { abort(404); } return $next($request); } }