Skip to content

Commit

Permalink
[11.x] Fix "Divide by Zero" regression bug introduced in #54650 (#54685)
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 authored Feb 19, 2025
1 parent c6820d9 commit 1af7e22
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 @@ -1028,7 +1028,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 1af7e22

Please sign in to comment.