コード例 #1
0
 /** @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]);
 }
コード例 #2
0
 /**
  * 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);
 }