while (true) { if ($current === $requested) { break; } if (! in_array($requested, $available)) { break; } session()->put('locale', $requested); break; }