diff --git a/src/Support/Format.php b/src/Support/Format.php index 334fe0a..0457b07 100644 --- a/src/Support/Format.php +++ b/src/Support/Format.php @@ -206,7 +206,7 @@ protected function formatCollection($collection): \Closure $collection instanceof LengthAwarePaginator => $item->paginateWith(new IlluminatePaginatorAdapter($collection)), $collection instanceof Paginator => $item->addMeta([ 'pagination' => [ - 'count' => count($collection->items()), + 'count' => $collection->lastItem(), 'per_page' => $collection->perPage(), 'current_page' => $collection->currentPage(), 'links' => array_filter([