Skip to content

Commit

Permalink
[11.x] Fix "Divide by Zero" regression bug introduced in #54650
Browse files Browse the repository at this point in the history
fixes #54679

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Feb 18, 2025
1 parent f03d3a1 commit 39d9770
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page',

$total = value($total) ?? $this->toBase()->getCountForPagination();

$perPage = value($perPage, $total) ?? $this->model->getPerPage();
$perPage = value($perPage, $total) ?: $this->model->getPerPage();

$results = $total
? $this->forPage($page, $perPage)->get($columns)
Expand Down

0 comments on commit 39d9770

Please sign in to comment.