original_string: public function paginate($perPage = 15, $columns = array('*'), $pageName = 'page', $page = null)
      {
          if (is_null($page)) {
              $page = Paginator::resolveCurrentPage($pageName);
          }
  
          $path = Paginator::resolveCurrentPath($pageName);
  
          //
          $total = $this->getPaginationCount();
  
          if ($total > 0) {
              $results = $this->forPage($page, $perPage)->get($columns);
          } else {
              $results = collect();
          }
  
          return new Paginator($results, $total, $perPage, $page, compact('path', 'pageName'));
      }
code: public function paginate($perPage = 15, $columns = array('*'), $pageName = 'page', $page = null)
      {
          if (is_null($page)) {
              $page = Paginator::resolveCurrentPage($pageName);
          }
  
          $path = Paginator::resolveCurrentPath($pageName);
  
          //
          $total = $this->getPaginationCount();
  
          if ($total > 0) {
              $results = $this->forPage($page, $perPage)->get($columns);
          } else {
              $results = collect();
          }
  
          return new Paginator($results, $total, $perPage, $page, compact('path', 'pageName'));
      }
code_tokens: public function paginate ( $ perPage = 15 , $ columns = array ( '*' ) , $ pageName = 'page' , $ page = null ) { if ( is_null ( $ page ) ) { $ page = Paginator :: resolveCurrentPage ( $ pageName ) ; } $ path = Paginator :: resolveCurrentPath ( $ pageName ) ; // $ total = $ this -> getPaginationCount ( ) ; if ( $ total > 0 ) { $ results = $ this -> forPage ( $ page , $ perPage ) -> get ( $ columns ) ; } else { $ results = collect ( ) ; } return new Paginator ( $ results , $ total , $ perPage , $ page , compact ( 'path' , 'pageName' ) ) ; }
docstring: Paginate the given query into a paginator.
  
  @param  int  $perPage
  @param  array  $columns
  @param  string  $pageName
  @param  int|null  $page
  @return \Nova\Pagination\Paginator
docstring_tokens: Paginate the given query into a paginator .