src/Rules/AllowedFieldSets.php
protected function notAllowed(string $resourceType, string $fields): Collection
    {
        $fields = collect(explode(',', $fields));

        if (!$this->allowed->has($resourceType)) {
            return $fields;
        }

        $allowed = $this->allowed->get($resourceType);

        if (is_null($allowed)) {
            return collect();
        }

        $allowed = collect((array) $allowed);

        return $fields->reject(function ($value) use ($allowed) {
            return $allowed->contains($value);
        });
    }
protected function notAllowed(string $resourceType, string $fields): Collection
    {
        $fields = collect(explode(',', $fields));

        if (!$this->allowed->has($resourceType)) {
            return $fields;
        }

        $allowed = $this->allowed->get($resourceType);

        if (is_null($allowed)) {
            return collect();
        }

        $allowed = collect((array) $allowed);

        return $fields->reject(function ($value) use ($allowed) {
            return $allowed->contains($value);
        });
    }
Get the invalid fields for the resource type.

@param string $resourceType
@param string $fields
@return Collection