gistfile1.txt public function paginate($perPage = null, $pageName = 'page', $page = null) { $engine = $this-engine(); $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this-model-getPerPage(); $results = Col
public function paginate($perPage = null, $pageName = 'page', $page = null) { $engine = $this->engine(); $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->getPerPage(); $results = Collection::make($engine->map( $rawResults = $engine->paginate($this, $perPage, $page), $this->model )); $paginator = (new LengthAwarePaginator($results, $engine->getTotalCount($rawResults), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ])); return $paginator->appends('query', $this->query); }