original_string: public function transform($data = null, $transformer = null, string $resourceKey = null):SuccessResponseBuilder
      {
          $resource = $this->resourceFactory->make($data);
  
          if (! is_null($resource->getData())) {
              $model = $this->resolveModel($resource->getData());
              $transformer = $this->resolveTransformer($model, $transformer);
              $resourceKey = $this->resolveResourceKey($model, $resourceKey);
          }
  
          if ($transformer instanceof Transformer) {
              $this->include($relations = $this->resolveNestedRelations($resource->getData()));
  
              if ($transformer->allRelationsAllowed()) {
                  $transformer->setRelations($relations);
              }
          }
  
          $this->resource = $resource->setTransformer($transformer)->setResourceKey($resourceKey);
  
          return $this;
      }
code: public function transform($data = null, $transformer = null, string $resourceKey = null):SuccessResponseBuilder
      {
          $resource = $this->resourceFactory->make($data);
  
          if (! is_null($resource->getData())) {
              $model = $this->resolveModel($resource->getData());
              $transformer = $this->resolveTransformer($model, $transformer);
              $resourceKey = $this->resolveResourceKey($model, $resourceKey);
          }
  
          if ($transformer instanceof Transformer) {
              $this->include($relations = $this->resolveNestedRelations($resource->getData()));
  
              if ($transformer->allRelationsAllowed()) {
                  $transformer->setRelations($relations);
              }
          }
  
          $this->resource = $resource->setTransformer($transformer)->setResourceKey($resourceKey);
  
          return $this;
      }
code_tokens: public function transform ( $ data = null , $ transformer = null , string $ resourceKey = null ) : SuccessResponseBuilder { $ resource = $ this -> resourceFactory -> make ( $ data ) ; if ( ! is_null ( $ resource -> getData ( ) ) ) { $ model = $ this -> resolveModel ( $ resource -> getData ( ) ) ; $ transformer = $ this -> resolveTransformer ( $ model , $ transformer ) ; $ resourceKey = $ this -> resolveResourceKey ( $ model , $ resourceKey ) ; } if ( $ transformer instanceof Transformer ) { $ this -> include ( $ relations = $ this -> resolveNestedRelations ( $ resource -> getData ( ) ) ) ; if ( $ transformer -> allRelationsAllowed ( ) ) { $ transformer -> setRelations ( $ relations ) ; } } $ this -> resource = $ resource -> setTransformer ( $ transformer ) -> setResourceKey ( $ resourceKey ) ; return $ this ; }
docstring: Set the transformation data. This will set a new resource instance on the response
  builder depending on what type of data is provided.
  
  @param  mixed|null           $data
  @param  callable|string|null $transformer
  @param  string|null          $resourceKey
  @return self
docstring_tokens: Set the transformation data . This will set a new resource instance on the response builder depending on what type of data is provided .