0

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.. ;)

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
Broshi
  • 3,334
  • 5
  • 37
  • 52

1 Answers1

0

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.

alexrussell
  • 13,856
  • 5
  • 38
  • 49