check()) { return redirect()->route('login')->with('error', 'You must be logged in to access this page.'); } // Check if user is admin if (!auth()->user()->is_admin) { abort(403, 'Unauthorized access. Admin privileges required.'); } return $next($request); } }