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