Laravel paginate and inRandomOrder #33821
Unanswered
omidMolaverdi
asked this question in
General
Replies: 4 comments 1 reply
-
Moving to discussions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
hi, is there any interest to this thread? |
Beta Was this translation helpful? Give feedback.
0 replies
-
What queries does this execute for you? |
Beta Was this translation helpful? Give feedback.
1 reply
-
What SQL does this query execute for the first and second page when you log it with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I realised that combining
paginate
andinRandomOrder
ends up the reverse order in the page numbers. To explain it more, if you have a code like below:and imagine that the table has 7 records. In the view I will see 3 records on page 1 and 4 records on page 2. If I drop
inRandomOrder
then the pagination is right [the right order here should be 4 on page 1 and 3 on page 2].Steps To Reproduce:
Beta Was this translation helpful? Give feedback.
All reactions