Browse Source

adding dropdown menus to mashes create blade, mkI

master
jk 3 years ago
parent
commit
7244c5b761
  1. 3
      app/Http/Controllers/MasheController.php
  2. 2
      resources/views/grainbills/create.blade.php
  3. 6
      resources/views/mashes/create.blade.php

3
app/Http/Controllers/MasheController.php

@ -75,7 +75,8 @@ class MasheController extends Controller
} }
public function create() public function create()
{ {
return view('mashes.create');
$beers = Summarie::orderBy('name')->get();
return view('mashes.create')->with('beers', $beers);
} }
public function destroy($id) public function destroy($id)
{ {

2
resources/views/grainbills/create.blade.php

@ -20,7 +20,7 @@
<label for="beer_id">Beer ID</label> <label for="beer_id">Beer ID</label>
<select> <select>
@foreach ($beers as $beer) @foreach ($beers as $beer)
<option name="beer_id" value="{{$beer->beer_id}}">"{{$beer->name}} (ID: {{$beer->beer_id}})"</option>
<option name="beer_id" value="{{$beer->beer_id}}">{{$beer->name}}</option>
@endforeach @endforeach
</select> </select>
</div> </div>

6
resources/views/mashes/create.blade.php

@ -18,7 +18,11 @@
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="beer_id">Beer ID</label> <label for="beer_id">Beer ID</label>
<input type="text" class="form-control" name="beer_id">
<select>
@foreach ($beers as $beer)
<option name="beer_id" value="{{$beer->beer_id}}">{{$beer->name}}</option>
@endforeach
</select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="temperature">Temperature</label> <label for="temperature">Temperature</label>

Loading…
Cancel
Save