Sort recipe ingredient options by name

This commit is contained in:
Christopher C. Wells 2021-01-15 04:53:18 -08:00
parent 03f9d5395a
commit 178d1d7aff
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class RecipeController extends Controller
*/ */
public function create(): View public function create(): View
{ {
$foods = Food::all(['id', 'name', 'detail'])->collect() $foods = Food::all(['id', 'name', 'detail'])->sortBy('name')->collect()
->map(function ($food) { ->map(function ($food) {
return [ return [
'value' => $food->id, 'value' => $food->id,