user(); if ($user !== null && $user->isStaff()) { return $next($request); } // A client navigating to a staff URL (stale intended-redirects // after login, old bookmarks) is sent home rather than shown an // error — staff pages are simply not part of their world. // Mutations stay a hard 403. if ($user !== null && $request->isMethod('GET') && ! $request->expectsJson()) { return redirect()->route('dashboard'); } abort(403); } }