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