|
|
@ -45,8 +45,8 @@ class SearchController extends Controller |
|
|
|
$grains = Grainbill::where('beer_id', $result->beer_id)->pluck('grain_id'); |
|
|
|
$grainarr = array(); |
|
|
|
foreach ($grains as $grain){ |
|
|
|
$grainname = Grain::where('id', $grain->id)->value('name'); |
|
|
|
array_push($grainarr, array('id'=>$grain->id, 'name'=>$grainname)); |
|
|
|
$grainname = Grain::where('id', $grain->grain_id)->value('name'); |
|
|
|
array_push($grainarr, array('id'=>$grain->grain_id, 'name'=>$grainname)); |
|
|
|
}; |
|
|
|
$result['grains'] = $grainarr; |
|
|
|
$yeasts = Fermentation::where('beer_id', $result->beer_id)->distinct('yeast_id'); |
|
|
|