Skip to content

Commit

Permalink
fix recourd count division by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Dec 19, 2023
1 parent 5bfe514 commit 9e9d534
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ tests/cypress/app/
.DS_Store
package-lock.json
tests/cypress/cypress/screenshots/*
composer.lock
4 changes: 3 additions & 1 deletion src/ProcessDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ private function applyPerPage(EloquentBuilder|QueryBuilder|MorphToMany $results)
return $results->$paginate($perPage);
}

return $results->$paginate($results->count());
$count = $results->count();

return $results->$paginate($count ?: 10);
}

/**
Expand Down

0 comments on commit 9e9d534

Please sign in to comment.