From ff5d1911bd367f3e70a1611da6f20cecfcdb6df5 Mon Sep 17 00:00:00 2001 From: jiannei Date: Wed, 11 Oct 2023 17:44:02 +0800 Subject: [PATCH] fix: simple paginate --- src/Support/Format.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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([