From 178d1d7affeaa2dddcc0dabfec333c159342545d Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Fri, 15 Jan 2021 04:53:18 -0800 Subject: [PATCH] Sort recipe ingredient options by name --- app/Http/Controllers/RecipeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/RecipeController.php b/app/Http/Controllers/RecipeController.php index 69384e4..db5c691 100644 --- a/app/Http/Controllers/RecipeController.php +++ b/app/Http/Controllers/RecipeController.php @@ -33,7 +33,7 @@ class RecipeController extends Controller */ public function create(): View { - $foods = Food::all(['id', 'name', 'detail'])->collect() + $foods = Food::all(['id', 'name', 'detail'])->sortBy('name')->collect() ->map(function ($food) { return [ 'value' => $food->id,