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()
{
return view('mashes.create');
$beers = Summarie::orderBy('name')->get();
return view('mashes.create')->with('beers', $beers);
}
public function destroy($id)
{

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

@ -20,7 +20,7 @@
<label for="beer_id">Beer ID</label>
<select>
@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
</select>
</div>

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

@ -18,7 +18,11 @@
@csrf
<div class="form-group">
<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 class="form-group">
<label for="temperature">Temperature</label>

Loading…
Cancel
Save