Update AccountController

This commit is contained in:
Daniel Supernault 2018-11-24 23:35:21 -07:00
parent fa99ab79c3
commit c40b4f5cfd
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -205,12 +205,10 @@ class AccountController extends Controller
$pid = $user->id; $pid = $user->id;
Cache::remember("user:filter:list:$pid", 1440, function() use($pid) { Cache::remember("user:filter:list:$pid", 1440, function() use($pid) {
$private = Profile::whereIsPrivate(true)->where('id', '!=', $pid)->pluck('id'); return UserFilter::whereUserId($pid)
$filters = UserFilter::whereUserId($pid)
->whereFilterableType('App\Profile') ->whereFilterableType('App\Profile')
->whereIn('filter_type', ['mute', 'block']) ->whereIn('filter_type', ['mute', 'block'])
->pluck('filterable_id')->toArray(); ->pluck('filterable_id')->toArray();
return array_merge($private->toArray(), $filters);
}); });
return redirect()->back(); return redirect()->back();
@ -259,12 +257,10 @@ class AccountController extends Controller
$pid = $user->id; $pid = $user->id;
Cache::remember("user:filter:list:$pid", 1440, function() use($pid) { Cache::remember("user:filter:list:$pid", 1440, function() use($pid) {
$private = Profile::whereIsPrivate(true)->where('id', '!=', $pid)->pluck('id'); return UserFilter::whereUserId($pid)
$filters = UserFilter::whereUserId($pid)
->whereFilterableType('App\Profile') ->whereFilterableType('App\Profile')
->whereIn('filter_type', ['mute', 'block']) ->whereIn('filter_type', ['mute', 'block'])
->pluck('filterable_id')->toArray(); ->pluck('filterable_id')->toArray();
return array_merge($private->toArray(), $filters);
}); });
return redirect()->back(); return redirect()->back();
} }