is_admin) { return $next($request); } return redirect(route('dashboard'))->with('error', 'You do not have admin access.'); } }