route('bo.login'), ]; if (! $request->expectsJson()) { // * Notify must login Session::flash('warning', trans('Veuillez vous connecter pour continuer')); foreach ($request->route()->gatherMiddleware() as $middleware) { if (\is_string($middleware) && str_contains($middleware, 'auth:')) { $route = $logins[str_replace('auth:', '', $middleware)] ?? null; if ($route) { return $route; } } } return route('fo.login'); } return null; } }