1
0
Fork 0

Update SearchController

This commit is contained in:
Daniel Supernault 2019-02-27 21:45:06 -07:00
parent 882081c285
commit 3193f558cf
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 1 additions and 1 deletions

View File

@ -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 [