Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
66f12ca6dc
  1. 6
      app/Http/Controllers/SearchController.php

6
app/Http/Controllers/SearchController.php

@ -24,7 +24,7 @@ class SearchController extends Controller
$table = $request->input('table'); $table = $request->input('table');
switch($table) { switch($table) {
case('summaries'):
case('summarie'):
$results = Summarie::where('keywords', 'LIKE', '%'.$search.'%')->orWhere('type', 'LIKE', '%'.$search.'%')->get(); $results = Summarie::where('keywords', 'LIKE', '%'.$search.'%')->orWhere('type', 'LIKE', '%'.$search.'%')->get();
foreach ($results as $result) { foreach ($results as $result) {
$brewery = Brewerie::where('id', $result->brewery_id)->value('name'); $brewery = Brewerie::where('id', $result->brewery_id)->value('name');
@ -67,13 +67,13 @@ class SearchController extends Controller
}; };
} }
break; break;
case('breweries'):
case('brewerie'):
break; break;
case('hops'): case('hops'):
break; break;
case('yeasts'):
case('yeast'):
break; break;
default: default:

Loading…
Cancel
Save