|
|
@ -102,6 +102,18 @@ class SearchController extends Controller |
|
|
|
$result['mashes']=$masharr; |
|
|
|
$hopadditions = Hopaddition::where('beer_id', $result->beer_id)->distinct('timing')->get(); |
|
|
|
$result['hopadditions'] = $hopadditions; |
|
|
|
$fermentations = Fermentation::where('beer_id', $result->beer_id)-get(); |
|
|
|
$fermentarr = array(); |
|
|
|
$i = 0; |
|
|
|
foreach ($fermentations as $fermentation){ |
|
|
|
if ($i == 0){ |
|
|
|
$fermentarr = array('stage'=>($i + 1), 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration); |
|
|
|
} else { |
|
|
|
array_push($fermentarr, array('stage'=>($i + 1), 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration)); |
|
|
|
}; |
|
|
|
$i++; |
|
|
|
}; |
|
|
|
$result['fermentations'] = $fermentarr; |
|
|
|
} |
|
|
|
break; |
|
|
|
case('brewerie'): |
|
|
|