protected function parseTransformer($transformer, Model $model)
    {
        if ($transformer instanceof Transformer) {
            $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations($model) : $transformer->getRelations();
            $transformer = $transformer->setRelations($relations);

        } elseif (! is_callable($transformer)) {
            throw new InvalidTransformerException($model);
        }

        return $transformer;
    }
protected function parseTransformer($transformer, Model $model)
    {
        if ($transformer instanceof Transformer) {
            $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations($model) : $transformer->getRelations();
            $transformer = $transformer->setRelations($relations);

        } elseif (! is_callable($transformer)) {
            throw new InvalidTransformerException($model);
        }

        return $transformer;
    }
protected function parseTransformer ( $ transformer , Model $ model ) { if ( $ transformer instanceof Transformer ) { $ relations = $ transformer -> allRelationsAllowed ( ) ? $ this -> resolveRelations ( $ model ) : $ transformer -> getRelations ( ) ; $ transformer = $ transformer -> setRelations ( $ relations ) ; } elseif ( ! is_callable ( $ transformer ) ) { throw new InvalidTransformerException ( $ model ) ; } return $ transformer ; }
Parse a transformer class and set relations.

@param  \Flugg\Responder\Transformer|callable $transformer
@param  \Illuminate\Database\ELoquent\Model   $model
@return \Flugg\Responder\Transformer|callable
@throws \InvalidTransformerException
Parse a transformer class and set relations .