Closed jaiselrahman closed 4 years ago
Looking sweet :)
Can you please add a couple of tests in MacrotTest.php asserting that the output is correct when setting encode_cursor => true
or when changing encoded_cursor_name
in config?
Something like this existing test:
I have added tests in both MacroTest.php
and CursorPaginatorTest.php
. Please check whether it is enough.
Thank you @jaiselrahman
Allow encoded cursor #4 by setting
'encode_cursor' => true
in config file.Then we can use url query like
http://127.0.0.1:8000/api/posts?cursor=eyJhZnRlcl9pIjoiMjAxOS0xMC0yMiAwODowMDo1NSJ9
which will provide following response:We can change the url query parameter by setting
'encoded_cursor_name' => 'page-id'
which produces the url:http://127.0.0.1:8000/api/posts?page-id=eyJhZnRlcl9pIjoiMjAxOS0xMC0yMiAwODowMDo1NSJ9