From 5cfa7f877c1580eab089ae6073a9ec23f5f3ecf7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 23 Dec 2018 22:07:19 -0700 Subject: [PATCH] Update SearchController --- app/Http/Controllers/SearchController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 5a0af8d1e..36103d528 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -22,7 +22,7 @@ class SearchController extends Controller return; } $hash = hash('sha256', $tag); - $tokens = Cache::remember('api:search:tag:'.$hash, 60, function () use ($tag) { + $tokens = Cache::remember('api:search:tag:'.$hash, 5, function () use ($tag) { $tokens = collect([]); $hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->limit(20)->get(); if($hashtags->count() > 0) { @@ -39,6 +39,7 @@ class SearchController extends Controller $tokens->push($tags); } $users = Profile::select('username', 'name', 'id') + ->whereNull('status') ->where('username', 'like', '%'.$tag.'%') ->limit(20) ->get();