Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
7537c7dc25
  1. 7
      app/Http/Controllers/SearchController.php

7
app/Http/Controllers/SearchController.php

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

Loading…
Cancel
Save