public function forPage($page, $perPage) { return $this->slice(($page - 1) * $perPage, $perPage); }
/** * Paginate the results of this query * * @param int * @param int * @return $this */ public function paginate($perPage, $page) { if ($perPage > 0) { $this->collection = $this->collection->forPage($page, $perPage); } return $this; }