|
@ -26,7 +26,7 @@ class SearchController extends Controller |
|
|
switch($table) { |
|
|
switch($table) { |
|
|
case('summaries'): |
|
|
case('summaries'): |
|
|
$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'); |
|
|
$result['brewery']=$brewery; |
|
|
$result['brewery']=$brewery; |
|
|
$hops = Hopaddition::where('beer_id', $result->beer_id)->distinct('hop_id'); |
|
|
$hops = Hopaddition::where('beer_id', $result->beer_id)->distinct('hop_id'); |
|
|