routeIs('password.change.form') || $request->routeIs('password.change.update') || $request->routeIs('logout'); if ($user->must_change_password && ! $isExemptRoute) { return redirect()->route('password.change.form') ->with('warning', 'You must set a new password before continuing.'); } } return $next($request); } }