src/Routing/VersionedHelpers.php
protected function transform($instance, string $transformer, ?string $serializer = null, array $options = [])
    {
        if (\is_null($serializer)) {
            $serializer = $transformer;
        }

        return $this->serializeWith(
            $this->transformWith($instance, $transformer, $options),
            $serializer,
            $options
        );
    }
protected function transform($instance, string $transformer, ?string $serializer = null, array $options = [])
    {
        if (\is_null($serializer)) {
            $serializer = $transformer;
        }

        return $this->serializeWith(
            $this->transformWith($instance, $transformer, $options),
            $serializer,
            $options
        );
    }
protected function transform ( $ instance , string $ transformer , ? string $ serializer = null , array $ options = [ ] ) { if ( \ is_null ( $ serializer ) ) { $ serializer = $ transformer ; } return $ this -> serializeWith ( $ this -> transformWith ( $ instance , $ transformer , $ options ) , $ serializer , $ options ) ; }
Transform and serialize the instance.

@param  \Orchestra\Model\Eloquent|\Illuminate\Support\Collection  $instance
@param  string  $transformer
@param  string|null  $serializer
@param  array  $options

@return array
Transform and serialize the instance .