Update DiscoverController

This commit is contained in:
Daniel Supernault 2018-08-30 22:18:43 -06:00
parent 2810b952dd
commit 0af5547dbb
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

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