From 41510433b5f9facd066a5b70fc1e5116c2896d88 Mon Sep 17 00:00:00 2001 From: jk Date: Wed, 23 Jun 2021 09:32:27 +0100 Subject: [PATCH] adding dropdown menus to fermentations create blade, mkI --- app/Http/Controllers/FermentationController.php | 5 ++++- resources/views/fermentations/create.blade.php | 16 ++++++++++++---- resources/views/grainbills/create.blade.php | 4 ++-- resources/views/hopadditions/create.blade.php | 4 ++-- resources/views/mashes/create.blade.php | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/FermentationController.php b/app/Http/Controllers/FermentationController.php index 722db05..ba21082 100644 --- a/app/Http/Controllers/FermentationController.php +++ b/app/Http/Controllers/FermentationController.php @@ -82,7 +82,10 @@ class FermentationController extends Controller } public function create() { - return view('fermentations.create'); + $beers = Summarie::orderBy('name')->get(); + $yeasts = Yeast::orderBy('name')->get(); + $data = array('beers'=>$beers, 'yeasts'=>$yeasts); + return view('fermentations.create')->with($data); } public function destroy($id) { diff --git a/resources/views/fermentations/create.blade.php b/resources/views/fermentations/create.blade.php index 8e3a906..5741e99 100644 --- a/resources/views/fermentations/create.blade.php +++ b/resources/views/fermentations/create.blade.php @@ -17,12 +17,20 @@
@csrf
- - + +
- - + +
diff --git a/resources/views/grainbills/create.blade.php b/resources/views/grainbills/create.blade.php index 0efff05..900195a 100644 --- a/resources/views/grainbills/create.blade.php +++ b/resources/views/grainbills/create.blade.php @@ -17,7 +17,7 @@ @csrf
- +
- + @foreach ($beers as $beer) @@ -25,7 +25,7 @@
- + @foreach ($beers as $beer)