query('mode'); $normalized = null; if (is_string($rawMode)) { $val = strtolower(trim($rawMode)); if (in_array($val, ['demo', 'real'], true)) { $normalized = $val; } } // If mode is missing or invalid → redirect to add/fix it (default demo) if ($normalized === null) { $normalized = 'demo'; $query = array_merge($request->query(), ['mode' => $normalized]); $url = $request->url() . (empty($query) ? '' : ('?' . http_build_query($query))); return redirect()->to($url, 302); } // Localhost provider integration for specific games $slugKey = strtolower($slug); $supported = [ 'dice' => 'dice', 'plinko' => 'plinko', 'mines' => 'mines', ]; $base = rtrim((string) config('games.providers.local.base_url', 'http://localhost:3001/games'), '/'); if (array_key_exists($slugKey, $supported)) { $gamePath = $supported[$slugKey]; $src = $base . '/' . $gamePath . '/index.html?mode=' . urlencode($normalized); $title = htmlspecialchars("Local Provider • {$slug} ({$normalized})", ENT_QUOTES, 'UTF-8'); $srcAttr = htmlspecialchars($src, ENT_QUOTES, 'UTF-8'); $slugJson = json_encode($slug, JSON_UNESCAPED_SLASHES); $modeJson = json_encode($normalized); $srcJson = json_encode($src, JSON_UNESCAPED_SLASHES); $html = <<
Unbekannter Slug: {$slug}
Mode: {$normalized}
Unterstützte lokale Spiele: dice, plinko, mines. Bitte URL prüfen.