amrnn90 / laravel-cursor-paginator

Cursor pagination for Laravel
MIT License
18 stars 6 forks source link

Allow base64 encoded cursor? #4

Closed trevorgehman closed 4 years ago

trevorgehman commented 4 years ago

It seems to be a common approach to base64 encode the cursor. I've seen Slack do it (https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12) as well as Facebook (https://developers.facebook.com/docs/graph-api/using-graph-api/).

What do you think about this? I like the idea of the cursor being an opaque string. One downside to the base64 encoding is the possibly present trailing equal signs = need to be url encoded. We could, of course, just strip those since they're only padding.

EDIT: Sorry to be adding multiple issues. I really appreciate your work on this package & want to provide useful feedback.

amrnn90 commented 4 years ago

That's a good idea, I'll try implementing it as soon as I can...feel free to submit a PR if you want to. No worries about the multiple issues, that's what they're made for...Your valuable feedback is much appreciated.

amrnn90 commented 4 years ago

Added by #5