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