fix(RecipeController): ensure perPage is at least 1 for pagination
This change prevents potential issues with pagination when there are no recipes.
This commit is contained in:
parent
9fc2690e74
commit
57a9db1fd5
1 changed files with 1 additions and 1 deletions
|
|
@ -55,7 +55,7 @@ class RecipeController extends Controller
|
|||
$mockedPaginatedRecipes = new LengthAwarePaginator(
|
||||
items: $allRecipes,
|
||||
total: count($allRecipes),
|
||||
perPage: count($allRecipes),
|
||||
perPage: max(1, count($allRecipes)),
|
||||
currentPage: 1,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue