/** @test */ public function it_unfollows_another_user() { $users = TestDummy::times(2)->create('Larabook\\Users\\User'); $this->repo->follow($users[1]->id, $users[0]); $this->repo->unfollow($users[1]->id, $users[0]); $this->tester->dontSeeRecord('follows', ['follower_id' => $users[0]->id, 'followed_id' => $users[1]->id]); }
/** * Follow one user * * @param $input * @return mixed */ public function followUser($input) { //Get Auth user $user = $this->userRepo->findById($input['user_id']); return $this->userRepo->follow($input['userToFollow'], $user); }