From 0af5547dbbe74ad89df96d9dfb1295aad52b83e8 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 30 Aug 2018 22:18:43 -0600 Subject: [PATCH] Update DiscoverController --- app/Http/Controllers/DiscoverController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Http/Controllers/DiscoverController.php b/app/Http/Controllers/DiscoverController.php index 09cd8b1ae..fada324fe 100644 --- a/app/Http/Controllers/DiscoverController.php +++ b/app/Http/Controllers/DiscoverController.php @@ -6,6 +6,7 @@ use App\Follower; use App\Hashtag; use App\Profile; use App\Status; +use App\UserFilter; use Auth; use Illuminate\Http\Request; @@ -23,6 +24,13 @@ class DiscoverController extends Controller $following = Follower::whereProfileId($pid) ->pluck('following_id'); + $filtered = UserFilter::whereUserId($pid) + ->whereFilterableType('App\Profile') + ->whereIn('filter_type', ['mute', 'block']) + ->pluck('filterable_id'); + + $following = $following->push($filtered); + $people = Profile::inRandomOrder() ->where('id', '!=', $pid) ->whereNotIn('id', $following)