Mrtvac's avatar
Level 1

Cursor paginate in Laravel Scout

Hi,

Is there any particular reason why cursorPaginate couldn't be implemented into Laravel Scout?

I haven't explored all search drivers but I presume it would be hard or not able to implement it in all search drivers? (except "database")

Because I'm using infinite scroll on large datasets, cursor paginate works better in our case and was planning on using it for "search" results as well but it seems I'll need to create additional consumer on FE for the "regular" pagination.

0 likes
1 reply
thepanda's avatar

Laravel scout returns IDs for matching models, you can query on those IDs using regular Eloquent or database query builder and use cursor pagination on that.

Please or to participate in this conversation.