diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 7e7f92f..3997d71 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -85,6 +85,22 @@ class SearchController extends Controller $i++; }; $result['adjuncts']=$adjunctarr; + $mashes = Mashe::where('beer_id', $result->beer_id)->get(); + $masharr = array(); + $i = 0; + foreach ($mashes as $mash){ + if ($mash->stage == 1) { + $result->boil = $mash->boil; + } + if ($i == 0){ + $masharr[] = array('id'=>$mash->id, 'stage'=>$mash->stage, 'duration'=>$mash->duration); + } else { + array_push($masharr, array('id'=>$mash->id, 'stage'=>$mash->stage, 'duration'=>$mash->duration)); + }; + $i++; + }; + $results['mashes']=$masharr; + $hopadditions = Hopaddition::where('beer_id', $result->beer_id)->distinct('timing')->get(); } break; case('brewerie'): diff --git a/resources/views/search/results.blade.php b/resources/views/search/results.blade.php index c12d222..c56fdd8 100644 --- a/resources/views/search/results.blade.php +++ b/resources/views/search/results.blade.php @@ -65,7 +65,7 @@ {{$result->ibu}} {{$result->ebc}} {{$result->srm}} - {{$result->pH}} + {{$result->ph}} @endforeach @@ -97,7 +97,28 @@ -
+
+ + + @include('inc.messages') + + + + + + + + + + @foreach ($results as $result) + + + + + + + @endforeach + @endif
@sortablelink('name', 'Beer')MashHop AdditionsFermentation
{{$result->name}} @foreach{{$result->mashes as $mash)Stage: {{$mash['stage']}} at {{$mash['temp']}}°C @if($mash['duration'])for {{$mash['duration']}}m@endforeach{{$result->boil}}m boil with hop additions at @foreach($result->hopadditions as $hopaddition) {{$hopaddition->timing}} @endforeachFermentation stuff