From 3603913f2ae53cbd0a2a2100846303ac38460098 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 19 Jul 2019 21:56:46 -0600 Subject: [PATCH] Update ProfileController, show follow request on private profiles --- app/Http/Controllers/ProfileController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index d5db00b10..870af7340 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use Auth; use Cache; use App\Follower; +use App\FollowRequest; use App\Profile; use App\User; use App\UserFilter; @@ -67,8 +68,12 @@ class ProfileController extends Controller $is_following = ($owner == false && Auth::check()) ? $user->followedBy(Auth::user()->profile) : false; if ($isPrivate == true || $isBlocked == true) { - return view('profile.private', compact('user', 'is_following')); + $requested = Auth::check() ? FollowRequest::whereFollowerId(Auth::user()->profile_id) + ->whereFollowingId($user->id) + ->exists() : false; + return view('profile.private', compact('user', 'is_following', 'requested')); } + $is_admin = is_null($user->domain) ? $user->user->is_admin : false; $profile = $user; $settings = [