Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cursor pagination? #204

Open
MohammadZarifiyan opened this issue Dec 20, 2024 · 2 comments
Open

How to use cursor pagination? #204

MohammadZarifiyan opened this issue Dec 20, 2024 · 2 comments

Comments

@MohammadZarifiyan
Copy link

How should i use cursor pagination with this package?

@MohammadZarifiyan
Copy link
Author

@Tucker-Eric Any help?

@Tucker-Eric
Copy link
Owner

We haven't implemented that. Would be open to a pr to have it officially supported the same way we handle the paginateFilter and simplePaginateFilter (which are done with scopes)

$query = User::filter($request->all())
$paginator = $query->cursorPaginate(15);
$paginator->appends($query->filtered);
return $paginator;

We store all the filtered items in the filtered property on the model so you'd be able to appends it to the paginator.

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

No branches or pull requests

2 participants