Skip to content

CursorPaginate not working well with ResourceCollection #37999

Closed
@kamui545

Description

@kamui545
  • 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions