original_string: protected function paginator(Paginator $paginator, Request $request)
      {
          foreach ($request->query as $key => $value) {
              if ($key != 'page') {
                  $paginator->appends($key, $value);
              }
          }
  
          $pagination = [
              'pagination' => [
                  'total'        => (int) $paginator->total(),
                  'count'        => count($paginator->items()),
                  'per_page'     => (int) $paginator->perPage(),
                  'current_page' => (int) $paginator->currentPage(),
                  'total_pages'  => (int) $paginator->lastPage(),
                  'links'        => [
                      'next_page'     => $paginator->nextPageUrl(),
                      'previous_page' => $paginator->previousPageUrl(),
                  ],
              ],
          ];
  
          $items = $paginator->getCollection();
  
          return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($items->values()))->respond();
      }
code: protected function paginator(Paginator $paginator, Request $request)
      {
          foreach ($request->query as $key => $value) {
              if ($key != 'page') {
                  $paginator->appends($key, $value);
              }
          }
  
          $pagination = [
              'pagination' => [
                  'total'        => (int) $paginator->total(),
                  'count'        => count($paginator->items()),
                  'per_page'     => (int) $paginator->perPage(),
                  'current_page' => (int) $paginator->currentPage(),
                  'total_pages'  => (int) $paginator->lastPage(),
                  'links'        => [
                      'next_page'     => $paginator->nextPageUrl(),
                      'previous_page' => $paginator->previousPageUrl(),
                  ],
              ],
          ];
  
          $items = $paginator->getCollection();
  
          return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($items->values()))->respond();
      }
code_tokens: protected function paginator ( Paginator $ paginator , Request $ request ) { foreach ( $ request -> query as $ key => $ value ) { if ( $ key != 'page' ) { $ paginator -> appends ( $ key , $ value ) ; } } $ pagination = [ 'pagination' => [ 'total' => ( int ) $ paginator -> total ( ) , 'count' => count ( $ paginator -> items ( ) ) , 'per_page' => ( int ) $ paginator -> perPage ( ) , 'current_page' => ( int ) $ paginator -> currentPage ( ) , 'total_pages' => ( int ) $ paginator -> lastPage ( ) , 'links' => [ 'next_page' => $ paginator -> nextPageUrl ( ) , 'previous_page' => $ paginator -> previousPageUrl ( ) , ] , ] , ] ; $ items = $ paginator -> getCollection ( ) ; return $ this -> setMetaData ( $ pagination ) -> setData ( AutoPresenter :: decorate ( $ items -> values ( ) ) ) -> respond ( ) ; }
docstring: Respond with a pagination response.
  
  @param \Illuminate\Pagination\Paginator $paginator
  @param \Illuminate\Http\Request         $request
  
  @return \Illuminate\Http\JsonResponse
docstring_tokens: Respond with a pagination response .