From bf90b649a7d8a2cc70e2913b1c0d0bf08b494e2d Mon Sep 17 00:00:00 2001 From: jk Date: Thu, 24 Jun 2021 15:50:36 +0100 Subject: [PATCH] first iteration of search functionality - likely to fail hard --- app/Http/Controllers/SearchController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index ec104e3..2fb4ae4 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -33,7 +33,7 @@ class SearchController extends Controller foreach ($results as $result) { $brewery = Brewerie::where('id', $result->brewery_id)->value('name'); $result['brewery']=$brewery; - $hops = Hopaddition::where('beer_id', $result->beer_id)->distinct('hop_id'); + $hops = Hopaddition::where('beer_id', $result->beer_id)->unique('hop_id'); $hoparr=array(); $i = 0; foreach ($hops as $hop){