Skip to content

Commit 39d9770

Browse files
committed
[11.x] Fix "Divide by Zero" regression bug introduced in #54650
fixes #54679 Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent f03d3a1 commit 39d9770

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page',
10131013

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

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

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

0 commit comments

Comments
 (0)