public function transform()
    {
        $presentation = [];

        if( ! $this->transformer) {
            return $presentation;
        }

        foreach ($this->resource as $key => $resource) {
            $presentation[$key] = Item::create($resource)->setTransformer($this->transformer)->transform();
        }

        return $presentation;
    }
public function transform()
    {
        $presentation = [];

        if( ! $this->transformer) {
            return $presentation;
        }

        foreach ($this->resource as $key => $resource) {
            $presentation[$key] = Item::create($resource)->setTransformer($this->transformer)->transform();
        }

        return $presentation;
    }
public function transform ( ) { $ presentation = [ ] ; if ( ! $ this -> transformer ) { return $ presentation ; } foreach ( $ this -> resource as $ key => $ resource ) { $ presentation [ $ key ] = Item :: create ( $ resource ) -> setTransformer ( $ this -> transformer ) -> transform ( ) ; } return $ presentation ; }
Present each item of the collection using a transformer.

@return array
Present each item of the collection using a transformer .