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

Pagination does not work #68

Closed
stollr opened this issue Apr 13, 2022 · 2 comments · Fixed by #72
Closed

Pagination does not work #68

stollr opened this issue Apr 13, 2022 · 2 comments · Fixed by #72

Comments

@stollr
Copy link
Collaborator

stollr commented Apr 13, 2022

I am trying to load persons in a paginated style. But it looks like this does not work.

$persons = PersonRequest::where('page', 1)
            ->where('limit', 10)
            ->get();

It always loads all persons. As far as I understand the reason is that the conditions are not added as query params to the request.

Edit
Right after sending this issue, I noticed that the Pagination trait iterates over all pages and merges them.
Isn't there a way to limit the result to one page?

@DumbergerL DumbergerL linked a pull request Jun 3, 2022 that will close this issue
@DumbergerL DumbergerL linked a pull request Jun 3, 2022 that will close this issue
@DumbergerL
Copy link
Contributor

@Naitsirch Thanks for your Issue and Pull-Request! I appreciate! I added a simple unit-test to cover the code and it worked fine!
I moved the documentation to a sub-page. I hope you are fine with this.

@stollr
Copy link
Collaborator Author

stollr commented Jun 7, 2022

Yes, of course! Thanks for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants