-
Notifications
You must be signed in to change notification settings - Fork 67
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
Improving : paginate() and supporting dynamic appends #12
Comments
@robsontenorio Hi and thanks for your proposal. I am examining :) |
@robsontenorio Hi again, I fixed pagination issue. Your proposal is cool but I can't use directly. Because this package is using several operator other than "=" (eg: <=, != etc.) So, I fixed this issue by adding new Paginator class that extends from LengthAwarePaginator. You can check this out 73ffd51 I'm working on "appends" idea now. I will release new version after complete it. I will inform you on here. Finally, @tttwb I'm so sorry for late. I did not get any notification about your issue from Github :| |
@robsontenorio @tttwb I released new version. 💯 👍 You can use it after https://github.com/selahattinunlu/laravel-api-query-builder/releases/tag/v1.5.0 |
Improving: add original query string on paginate() method
Problem
The current paginate() method does not includes the original query parameters on "url pages"
http://localhost:8025/app/public/users?includes=city&country=US&limit=10&page=4
results ...
Proposal
Now "next_page_url" and "prev_page_url" includes the original query string
Supporting dynamic appends() on Laravel models
Static way
On Laravel models we have "$appends = ['is_admin', 'balance']" attribute that allow us to add some custom attributes to our model.
Dynamic way
$user = User::find(1)->append(['is_admin', 'balance']);
Full solution : fixing query string on paginate() and adding support to dynamic append()
NOTE: The same append() logic would be applied on get() method (except "query string" issue).
The text was updated successfully, but these errors were encountered: