Skip to content

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

4 participants