|
@ -48,7 +48,12 @@ class SearchController extends Controller |
|
|
foreach ($grains as $grain){ |
|
|
foreach ($grains as $grain){ |
|
|
$grainname = Grain::where('id', $grain->id)->value('name'); |
|
|
$grainname = Grain::where('id', $grain->id)->value('name'); |
|
|
$grainarr = array('id'=>$grain->id, 'name'=>$grainname); |
|
|
$grainarr = array('id'=>$grain->id, 'name'=>$grainname); |
|
|
array_push($result['grains'],$grainarr); |
|
|
|
|
|
|
|
|
if ($i == 0) { |
|
|
|
|
|
$result['grains'] = $grainarr; |
|
|
|
|
|
} else { |
|
|
|
|
|
array_push($result['grains'],$grainarr); |
|
|
|
|
|
} |
|
|
|
|
|
$i++; |
|
|
}; |
|
|
}; |
|
|
$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']=[]; |
|
|