protected function transformWith($instance, string $name, array $options = [])
    {
        $transformer = $this->getVersionedResourceClassName('Transformers', $name);

        if (\class_exists($transformer)) {
            $transformer = \resolve($transformer);

            if ($transformer instanceof Transformer) {
                return $transformer->options($options)->handle($instance);
            }

            if ($transformer instanceof BaseTransformer) {
                return $transformer->handle($instance);
            }

            return $instance->transform($transformer);
        }

        return $instance;
    }