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

[8.x] Fix issue with cursor pagination and Json resources #38026

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Jul 15, 2021

This PR fixes an issue with cursor based pagination and JSON resources. When using JsonResources and collections, items from a paginator will be mapped into JsonResource instances. Therefor, we should use the underlying wrapped resource to build up the pagination state and the cursor.

Fixes #37999

@driesvints driesvints changed the title Fix issue with cursor pagination and Json resources [8.x] Fix issue with cursor pagination and Json resources Jul 15, 2021
@taylorotwell taylorotwell merged commit 345c086 into 8.x Jul 15, 2021
@taylorotwell taylorotwell deleted the fix-cursor-pagination-with-resources branch July 15, 2021 18:57
@francoism90
Copy link

@driesvints Is this related spatie/laravel-query-builder#645? A workaround exists (see second comment), but I don't know if this is a bug?

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

Successfully merging this pull request may close these issues.

CursorPaginate not working well with ResourceCollection
3 participants