public function paginatedCollection(Paginator $paginator, $transformer = null, $resourceKey = null) { $paginator->appends(\Request::query()); $resource = new Collection($paginator->getCollection(), $this->getTransformer($transformer), $resourceKey); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); return $this->manager->createData($resource)->toArray(); }
/** * Prepare query for pagination * * @return $this */ protected function preparePagination() { $this->setQuerySortable(); // set paginator $this->paginator = $this->getQuery()->paginate($this->getPerPage()); $this->paginator->appends(Request::except('ajax')); return $this; }
/** * @param string $view * * @return mixed */ public function links($view = null) { if ($this->limit) { if ($this->hash != '') return $this->paginator->appends($this->url->remove('page')->getArray())->fragment($this->hash)->render($view); else return $this->paginator->appends($this->url->remove('page')->getArray())->render($view); } }
/** * @param string $view * * @return mixed */ public function links($view = null) { if ($this->limit) { if ($this->hash != '') { $links = $this->paginator->appends($this->url->remove('page' . $this->cid)->getArray())->fragment($this->hash)->render($view); } else { $links = $this->paginator->appends($this->url->remove('page' . $this->cid)->getArray())->render($view); } return str_replace('/?', '?', $links); } }
/** * Flexible pagination links. * * @param Paginator $data * @return mixed */ function pagination_links(Paginator $data) { if ($query = request()->query()) { $query = array_except($query, 'page'); return $data->appends($query)->links(); } return $data->links(); }
/** * Use a custom pagination style. */ public function paginate(Paginator $model) : string { return with(new SemanticUIPagination($model->appends($this->request->query())))->render(); }