user()->type == $userType) { return $next($request); } return response()->json(['You do not have permission to access for this page']); } }