fast-paginate
fast-paginate copied to clipboard
perPage -1 will give zero (0) result instead of all result
before, using paginate(-1)
will give you "all" results.
But it seems fastPaginate(-1)
gives us zero results.
The issue maybe because of fastPaginate under the hood uses simplePaginate(), which also returns 0 with if supplied with per page -1
standar query
fast paginate query
Interesting! I didn't know that about -1
, I'll add a test for that and fix it. Thanks!
Yeah, it's a trick if you want to show all the records without making additional count query. though after further investigation, it seems to be the simplePagination issue?
this using is really interesting, so what is the advantage or disadvantage of this using?
Landed here looking for how to get all records without limit. Any advice? I'm using 99999 value but it looks like a horrible hack.
I can't figure out how this is supposed to work. Doing User::paginate(-1)
throws an error for me on MySQL. What database are y'all using? Either way, I added a check to see if the page is -1
and if it is it will defer to the Laravel methods.
https://github.com/hammerstonedev/fast-paginate/commit/e0dc0839d90e17d16ae93375cbebd9dbfccb16f7