Skip to content

Commit 92bc9ae

Browse files
committed
Fixed paginate method in query to use length aware paginator class
1 parent f9e9e00 commit 92bc9ae

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Mmanos/Search/Query.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace Mmanos\Search;
22

33
use App, Input;
4+
use Illuminate\Pagination\LengthAwarePaginator;
45

56
class Query
67
{
@@ -220,17 +221,15 @@ public function delete()
220221
*
221222
* @param int $num
222223
*
223-
* @return \Illuminate\Pagination\Paginator
224+
* @return \Illuminate\Pagination\LengthAwarePaginator
224225
*/
225226
public function paginate($num = 15)
226227
{
227-
$paginator = App::make('paginator');
228-
229228
$page = (int) Input::get('page', 1);
230229

231230
$this->limit($num, ($page - 1) * $num);
232231

233-
return $paginator->make($this->get(), $this->count(), $num);
232+
return new LengthAwarePaginator($this->get(), $this->count(), $num, $page);
234233
}
235234

236235
/**

0 commit comments

Comments
 (0)