@ -72,7 +72,10 @@ class HopAdditionController extends Controller
}
public function create()
{
return view('hopadditions.create');
$beers = Summarie::orderBy('name')->get();
$hops = Hop::orderBy('name')->get();
$data = array('beers'=>$beers, 'hops'=>$hops);
return view('hopadditions.create')->with($data);
public function destroy($id)
@ -18,11 +18,19 @@
@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>
<label for="hop_id">Hop ID</label>
<input type="text" class="form-control" name="hop_id" >
@foreach ($hops as $hop)
<option name="hop_id" value="{{$hop->id}}">{{$hop->name}}</option>
<label for="amount">Amount</label>