Skip to content

Commit 767ed0e

Browse files
authored
Merge pull request #13 from adhenrique/develop
adding support to change offset of paginate
2 parents d043328 + ebbf205 commit 767ed0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Services/SearchService.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class SearchService
1313
protected SearchModel $model;
1414
protected FilterService $filterService;
1515
protected int $perPage = 15;
16+
protected int $paginateOffset = 0;
1617

1718
public function __construct(SearchModel $model, FilterService $filterService)
1819
{
@@ -32,7 +33,7 @@ public function all(Request $request)
3233

3334
if ($paginate) {
3435
return $builder
35-
->paginate($perPage, [$this->model->getTable().".*"], 'page', $page);
36+
->paginate($perPage, [$this->model->getTable().".*"], 'page', $page + $this->paginateOffset);
3637
}
3738
return $builder->get();
3839
}

0 commit comments

Comments
 (0)