Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
d75408158f
  1. 2
      app/Http/Controllers/SearchController.php
  2. 9
      resources/views/search/index.blade.php

2
app/Http/Controllers/SearchController.php

@ -67,7 +67,7 @@ class SearchController extends Controller
foreach ($adjuncts as $adjunct){ foreach ($adjuncts as $adjunct){
$adjunctname = Adjunct::where('id', $adjunct->id)->value('name'); $adjunctname = Adjunct::where('id', $adjunct->id)->value('name');
$result['adjuncts'][$i]['id'] = $adjunct->id; $result['adjuncts'][$i]['id'] = $adjunct->id;
$result['adjuncts'][$i]['name'] = $hopname;
$result['adjuncts'][$i]['name'] = $adjunctname;
$i++; $i++;
}; };
} }

9
resources/views/search/index.blade.php

@ -2,15 +2,14 @@
@csrf @csrf
<div class="form-group"> <div class="form-group">
<span id="radios"> <span id="radios">
<input type="radio" class="form-control" id="summarie" value="summarie" name="table" checked>
<input type="radio" id="summarie" value="summarie" name="table" checked>
<label for="summarie">Beers</label> <label for="summarie">Beers</label>
<input type="radio" class="form-control" id="brewerie" value="brewerie" name="table" >
<input type="radio" id="brewerie" value="brewerie" name="table" >
<label for="">Breweries</label> <label for="">Breweries</label>
<input type="radio" class="form-control" id="hops" value="hops" name="table" >
<input type="radio" id="hops" value="hops" name="table" >
<label for="">Hops</label> <label for="">Hops</label>
<input type="radio" class="form-control" id="yeasts" value="yeast" name="table" >
<input type="radio" id="yeasts" value="yeast" name="table" >
<label for="">Yeasts</label></span> <label for="">Yeasts</label></span>
<input type="text" class="form-control" name="search" /> <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i></button> <input type="text" class="form-control" name="search" /> <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i></button>
</div> </div>
</form> </form>
Loading…
Cancel
Save