From 57a9db1fd55284ed276dcc76115a76f780fbae8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Thu, 9 Jul 2026 11:02:22 +0200 Subject: [PATCH] fix(RecipeController): ensure perPage is at least 1 for pagination This change prevents potential issues with pagination when there are no recipes. --- app/Http/Controllers/Front/RecipeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Front/RecipeController.php b/app/Http/Controllers/Front/RecipeController.php index 5197a69b..c72a8104 100644 --- a/app/Http/Controllers/Front/RecipeController.php +++ b/app/Http/Controllers/Front/RecipeController.php @@ -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, );