user(); if ($operator === null || $operator->two_factor_confirmed_at !== null) { return $next($request); } // The one page that must stay reachable: where two-factor is enrolled. if (\App\Support\AdminArea::routeIs('admin.settings') || $request->routeIs('admin.logout')) { return $next($request); } return redirect()->route('admin.settings') ->with('status', __('admin_settings.two_factor_required')); } }