Level 75
You can use the lengthaware paginator. https://laracasts.com/discuss/channels/guides/length-aware-paginator
Hi guys,
Is it possible in Laravel to change the pagination query (only in specific cases) from:
SELECT COUNT(*) AS aggregate...
To:
SELECT COUNT(id) AS aggregate...?
We're still running a Laravel 4.2 project. Select count(id) will be a bit more efficient for the database.
I couldn't find an answer to this question anywhere on the internet.
Thank you.
You can use the lengthaware paginator. https://laracasts.com/discuss/channels/guides/length-aware-paginator
Please or to participate in this conversation.