|
@ -51,7 +51,12 @@ class GrainbillController extends Controller |
|
|
} |
|
|
} |
|
|
public function edit($id){ |
|
|
public function edit($id){ |
|
|
$grainbill = Grainbill::where('id', (int)$id)->first(); |
|
|
$grainbill = Grainbill::where('id', (int)$id)->first(); |
|
|
return view('grainbills.edit')->with('grainbill', $grainbill); |
|
|
|
|
|
|
|
|
$beers = Summarie::orderBy('name')->get(); |
|
|
|
|
|
$selected_beer = $grainbill->beer_id; |
|
|
|
|
|
$grains = Grain::orderBy('name')->get(); |
|
|
|
|
|
$selected_grain = $grainbill->grain_id; |
|
|
|
|
|
$data = array('grainbill'=>$grainbill, 'beers'=>$beers, 'grains'=>$grains, 'selected_beer'=>$selected_beer, 'selected_grain'=>$selected_grain); |
|
|
|
|
|
return view('grainbills.edit')->with($data); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function update(Request $request, $id){ |
|
|
public function update(Request $request, $id){ |
|
|