src/Http/Response/Factory.php
public function item($item, $transformer, $parameters = [], Closure $after = null)
    {
        $class = get_class($item);

        if ($parameters instanceof \Closure) {
            $after = $parameters;
            $parameters = [];
        }

        $binding = $this->transformer->register($class, $transformer, $parameters, $after);

        return new Response($item, 200, [], $binding);
    }
public function item($item, $transformer, $parameters = [], Closure $after = null)
    {
        $class = get_class($item);

        if ($parameters instanceof \Closure) {
            $after = $parameters;
            $parameters = [];
        }

        $binding = $this->transformer->register($class, $transformer, $parameters, $after);

        return new Response($item, 200, [], $binding);
    }
public function item ( $ item , $ transformer , $ parameters = [ ] , Closure $ after = null ) { $ class = get_class ( $ item ) ; if ( $ parameters instanceof \ Closure ) { $ after = $ parameters ; $ parameters = [ ] ; } $ binding = $ this -> transformer -> register ( $ class , $ transformer , $ parameters , $ after ) ; return new Response ( $ item , 200 , [ ] , $ binding ) ; }
Bind an item to a transformer and start building a response.

@param object                 $item
@param string|callable|object $transformer
@param array                  $parameters
@param \Closure               $after

@return \Dingo\Api\Http\Response
Bind an item to a transformer and start building a response .