Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
cc6f028433
  1. 3
      app/Http/Controllers/SearchController.php

3
app/Http/Controllers/SearchController.php

@ -48,7 +48,8 @@ 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);
$result['grains'][] = $grainarr;
$result['grains'][$i] = $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']=[];

Loading…
Cancel
Save