diff --git a/src/EloquentBuilder.php b/src/EloquentBuilder.php index 08957ee..9594cd2 100644 --- a/src/EloquentBuilder.php +++ b/src/EloquentBuilder.php @@ -138,7 +138,7 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $results = $this->forPage($page, $perPage)->get($columns); - $total = $this->toBase()->getCountForPagination($columns); + $total = $this->query->getProcessor()->getRawResponse()['hits']['total']['value']; return new LengthAwarePaginator($results, $total, $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(),