diff --git a/app/Http/Controllers/BrewerieController.php b/app/Http/Controllers/BrewerieController.php index e697a65..b33e669 100644 --- a/app/Http/Controllers/BrewerieController.php +++ b/app/Http/Controllers/BrewerieController.php @@ -45,7 +45,10 @@ class BrewerieController extends Controller public function edit($id){ $brewery = Brewerie::where('id', (int)$id)->first(); - return view('breweries.edit')->with('brewery', $brewery); + $breweries = Brewerie::orderBy('name')->get(); + $selected_brewery = $brewery->name; + $data = array('brewery'=>$brewery, 'breweries'=>$breweries, 'selected_brewery'=>$selected_brewery); + return view('breweries.edit')->with($data); } public function update(Request $request, $id) diff --git a/resources/views/beers/edit.blade.php b/resources/views/beers/edit.blade.php index 44c2b08..8a41807 100644 --- a/resources/views/beers/edit.blade.php +++ b/resources/views/beers/edit.blade.php @@ -50,7 +50,7 @@
- + name }} /> +