Skip to content

Commit ebbf205

Browse files
committed
adding support to change offset of paginate
1 parent b1a99c8 commit ebbf205

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Services/SearchService.php

Lines changed: 2 additions & 1 deletion
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)