From 3193f558cf17c6ff19d9c2f2e251589e673255ae Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 21:45:06 -0700 Subject: [PATCH] Update SearchController --- 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 ea6c074a1..7f371d3bc 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -54,7 +54,7 @@ class SearchController extends Controller } } - $hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->limit(20)->get(); + $hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->whereHas('posts')->limit(20)->get(); if($hashtags->count() > 0) { $tags = $hashtags->map(function ($item, $key) { return [