Skip to content

Commit

Permalink
Add Builder Macro paginateSafe
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Jun 1, 2024
1 parent b30bea9 commit 5f06dab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Providers/PowerGridServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ private function macros(): void
$perPage = $perPage ?: $this->model->getPerPage();

$results = $this->model->newCollection(
$engine->map($this, $rawResults = $engine->paginate($this, $perPage, $page),
$this->model
)->all());
$engine->map(
$this,
$rawResults = $engine->paginate($this, $perPage, $page),
$this->model
)->all()
);

return Container::getInstance()->makeWith(LengthAwarePaginator::class, [
'items' => $results,
Expand Down

0 comments on commit 5f06dab

Please sign in to comment.