laravel/framework — pull request #1552 by dirkpostma (2013-06-06 10:56:19+00:00)
Title: Fix pagination when using distinct() in Query or Eloquent

Pagination works correcty when using groupBy(), but not when distinct() is used. I think this patch fixes this issue, but please have a good look at it as I don't know the ins and outs of L4.