public function transform($data, $transformer = null, $resourceKey = null, PaginatorInterface $adapter = null)
    {
        if (!$transformer) {
            $transformer = $this->getTransformer();
        }

        $fractal = $this->getService();

        if ($this->isCollection($data)) {
            return $fractal->collection($data, $transformer, $resourceKey, $adapter);
        }

        return $fractal->item($data, $transformer, $resourceKey);
    }
public function transform($data, $transformer = null, $resourceKey = null, PaginatorInterface $adapter = null)
    {
        if (!$transformer) {
            $transformer = $this->getTransformer();
        }

        $fractal = $this->getService();

        if ($this->isCollection($data)) {
            return $fractal->collection($data, $transformer, $resourceKey, $adapter);
        }

        return $fractal->item($data, $transformer, $resourceKey);
    }
public function transform ( $ data , $ transformer = null , $ resourceKey = null , PaginatorInterface $ adapter = null ) { if ( ! $ transformer ) { $ transformer = $ this -> getTransformer ( ) ; } $ fractal = $ this -> getService ( ) ; if ( $ this -> isCollection ( $ data ) ) { return $ fractal -> collection ( $ data , $ transformer , $ resourceKey , $ adapter ) ; } return $ fractal -> item ( $ data , $ transformer , $ resourceKey ) ; }
transform data.

@param                                                    $data
@param null|mixed|\Callable                               $transformer
@param null                                               $resourceKey
@param \League\Fractal\Pagination\PaginatorInterface|null $adapter

@return \Cyvelnet\Laravel5Fractal\Adapters\ScopeDataAdapter|mixed
transform data .