Laravel Version
11.13
PHP Version
8.3
Database Driver & Version
No response
Description
Paginate should return the correct total (not the total provided by the user when providing one)
Currently the code in paginate is $total = value($total) ?? $this->toBase()->getCountForPagination();
But I believe it should be $total = $total ? min(value($total), $this->toBase()->getCountForPagination()) : $this->toBase()->getCountForPagination();
Steps To Reproduce
Paginate any model, if you choose the total to be 10000, it will return 10000 even if there is less than that in the total count of the model