untymage's avatar

How to use Cursor Pagination in non web app ?

I want to paginate my data in none web application using cursor pagination, But how can i use it ?

for example how can i go to the next page or prev page ?

$c = DB::table('users')->orderBy('id')->where('name', 'like', 'alex%')->cursorPaginate();

$c->nextCursor()->encode() //eyJpZCI6MTwekxNSwiX3BvaWw50c1RvTmV4dEl0ZW1zIjp0cnVlfQ

how to use that hash to go next page ?

0 likes
1 reply
jlrdw's avatar

Works the same as a web app. You are just finding a greater than a last result.

1 like

Please or to participate in this conversation.