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:
Jérémy Munsch 2026-07-09 11:02:22 +02:00
parent 9fc2690e74
commit 57a9db1fd5
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4

View file

@ -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,
);