src/FractalTransformFactory.php
protected function parseOptions(array $options, ResourceInterface $resource): array
    {
        $options = array_merge([
            'includes' => [],
            'excludes' => [],
            'fieldsets' => [],
        ], $options);

        if (! empty($options['fieldsets'])) {
            if (is_null($resourceKey = $resource->getResourceKey())) {
                throw new LogicException('Filtering fields using sparse fieldsets require resource key to be set.');
            }

            $options['fieldsets'] = $this->parseFieldsets($options['fieldsets'], $resourceKey, $options['includes']);
        }

        return $options;
    }
protected function parseOptions(array $options, ResourceInterface $resource): array
    {
        $options = array_merge([
            'includes' => [],
            'excludes' => [],
            'fieldsets' => [],
        ], $options);

        if (! empty($options['fieldsets'])) {
            if (is_null($resourceKey = $resource->getResourceKey())) {
                throw new LogicException('Filtering fields using sparse fieldsets require resource key to be set.');
            }

            $options['fieldsets'] = $this->parseFieldsets($options['fieldsets'], $resourceKey, $options['includes']);
        }

        return $options;
    }
Parse the transformation options.

@param  array                                      $options
@param  \League\Fractal\Resource\ResourceInterface $resource
@return array