diff --git a/src/Fadion/Bouncy/ElasticCollection.php b/src/Fadion/Bouncy/ElasticCollection.php index 64c0ee1..eb7d2b5 100644 --- a/src/Fadion/Bouncy/ElasticCollection.php +++ b/src/Fadion/Bouncy/ElasticCollection.php @@ -1,7 +1,7 @@ items, count($this->items), $perPage); + $paginator = new Paginator($this->items, $perPage); - $start = ($paginator->getCurrentPage() - 1) * $perPage; + $start = ($paginator->currentPage() - 1) * $perPage; $sliced = array_slice($this->items, $start, $perPage); - return Paginator::make($sliced, count($this->items), $perPage); + return new Paginator($sliced, $perPage); } /** @@ -130,4 +130,4 @@ public function shards($key = null) return $shards; } -} \ No newline at end of file +}