Skip to content

Commit

Permalink
Merge pull request #26 from wcjonathan/master
Browse files Browse the repository at this point in the history
Pagination Issue: nbPages undefined index fix
  • Loading branch information
taylorotwell committed Aug 21, 2016
2 parents 584ff74 + 3a2ecd5 commit 172d156
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Builder.php
Expand Up @@ -139,7 +139,7 @@ public function paginate($perPage = 15, $pageName = 'page', $page = null)
]));

return $paginator->appends('query', $this->query)
->hasMorePagesWhen($rawResults['nbPages'] > $page);
->hasMorePagesWhen(($results->count() / $perPage) > $page);
}

/**
Expand Down

1 comment on commit 172d156

@dvlpp
Copy link

@dvlpp dvlpp commented on 172d156 Aug 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this fix... Seems to me that $results->count() is always == to the per page count.

Please sign in to comment.