We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
11.13
8.3
No response
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();
$total = value($total) ?? $this->toBase()->getCountForPagination();
But I believe it should be $total = $total ? min(value($total), $this->toBase()->getCountForPagination()) : $this->toBase()->getCountForPagination();
$total = $total ? min(value($total), $this->toBase()->getCountForPagination()) : $this->toBase()->getCountForPagination();
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
The text was updated successfully, but these errors were encountered:
See #46410
Sorry, something went wrong.
The $total parameter was added to skip running the default aggregate count query, so this seems to be the expected behavior now.
$total
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: