src/Managers/DocumentManager.php
/**
     * Convert item instance to document.
     *
     * @param mixed $item Item for which documents should be composed.
     * @return array Composed document.
     */
Convert item instance to document.
@param mixed $item Item for which documents should be composed.
@return array Composed document.
Convert item instance to document . @param mixed $item Item for which documents should be composed . @return array Composed document .
protected function toDocument($item): array
    {
        $transformer = $this->getTransformerByIndexName($this->getIndexName($item));
        return $this->fractal
            ->createData(new FractalItem($item, $transformer))
            ->toArray();
    }
protected function toDocument ( $ item ) : array { $ transformer = $ this -> getTransformerByIndexName ( $ this -> getIndexName ( $ item ) ) ; return $ this -> fractal -> createData ( new FractalItem ( $ item , $ transformer ) ) -> toArray ( ) ; }
Convert item instance to document.
Convert item instance to document .