public function paginator(Paginator $paginator, $transformer, array $parameters = [], Closure $after = null)
    {
        if ($paginator->isEmpty()) {
            $class = \get_class($paginator);
        } else {
            $class = \get_class($paginator->first());
        }

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

        return new Response($paginator, 200, [], $binding);
    }
public function paginator(Paginator $paginator, $transformer, array $parameters = [], Closure $after = null)
    {
        if ($paginator->isEmpty()) {
            $class = \get_class($paginator);
        } else {
            $class = \get_class($paginator->first());
        }

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

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

@param \Illuminate\Contracts\Pagination\Paginator $paginator
@param string|callable|object                     $transformer
@param array                                      $parameters
@param \Closure                                   $after

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