Update FollowerController

pull/443/head
Daniel Supernault 7 years ago
parent 9b501e9c59
commit 38d6d58dc8
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -34,10 +34,10 @@ class FollowerController extends Controller
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count(); $isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count();
if($private == true && $isFollowing == 0) { if($private == true && $isFollowing == 0) {
$follow = new FollowRequest; $follow = FollowRequest::firstOrCreate([
$follow->follower_id = $user->id; 'follower_id' => $user->id,
$follow->following_id = $target->id; 'following_id' => $target->id
$follow->save(); ]);
} elseif ($isFollowing == 0) { } elseif ($isFollowing == 0) {
$follower = new Follower(); $follower = new Follower();
$follower->profile_id = $user->id; $follower->profile_id = $user->id;

Loading…
Cancel
Save