I have a quite-complex query with lots of joins and wheres via Eloquent instance which starts with

$user = new User;
$query =User::join('table','users.id','=','table.id');

After that i'm looping and adding lots of ->whereRaw() entries.

In the end of it, im running:

return $query->paginate(30);

on the view itself i'm running

{{ $records->appends($_GET)->links() }}

Everything looks OK but the thing is that after the first page (when I paginate to page #2) the paginator links are stuck on 2 and doesnt go on.

Probably a CodeIgniter thinking tried on Laravel.. ;)

有帮助吗?

解决方案

You're passing the page number to appends (as you're passing the whole of $_GET) which is why it gets stuck. Either be more specific with your appends call or use Input::except('page') or similar.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top