mysql - Laravel ORM/Query builder how get the next page result/content -
hi need on how make query return remaining data 10 using laravel pagination.
i have 15 numbers of data on table, on first request returns first 10 data correct, need remaining 5.
i doing using jquery infinite scroll i'm not showing pagination or links/urls on view
public function index() { $query = task::wheredate('due', '<', date('y-m-d')) ->where('task_phase_id', '<>', 4) ->where('task_status_id', '<>', 9) ->paginate(10); dd($query); }
thanks in advance,
if convert $query
json, you'll have object attribute called next_page_url
(see doc here).
it looks http://laravel.app?page=2
.
you can use has request url jquery.
e.g : when scroll page bottom, call next_page_url
Comments
Post a Comment