Skip to content
New issue

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

CursorPaginate not working well with ResourceCollection #37999

Closed
kamui545 opened this issue Jul 13, 2021 · 2 comments · Fixed by #38026
Closed

CursorPaginate not working well with ResourceCollection #37999

kamui545 opened this issue Jul 13, 2021 · 2 comments · Fixed by #38026
Labels

Comments

@kamui545
Copy link
Contributor

  • Laravel Version: 8.50.0
  • PHP Version: 8.0.8
  • Database Driver & Version: MySQL

Description:

I noticed another issue while playing around with the cursor pagination. (please don't hate me 🙈)
If you actually use a ResourceCollection as output, the wrong cursor will be used for the pagination links.

For example if you're sorting on pivot.id, it will use user.id.

Steps To Reproduce:

If you pull my repo previously created for #37915, there is a new route /collection with some debug outputs.

Screen Shot 2021-07-13 at 22 02 22

In this case, it should always be 26 instead of 42.

@driesvints
Copy link
Member

Thanks @kamui545. I'll take a look later this week.

@driesvints
Copy link
Member

Got it: #38026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants