Update FollowerController

pull/443/head
Daniel Supernault 2018-09-02 22:00:31 -06:00
rodzic 9b501e9c59
commit 38d6d58dc8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

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