Instagram\Instagram::unfollowUser PHP Method

unfollowUser() public method

Unfollow User
public unfollowUser ( string | User $userId ) : DestroyFriendshipResponse
$userId string | Instagram\API\Response\Model\User User or User Id to Unfollow
return Instagram\API\Response\DestroyFriendshipResponse
    public function unfollowUser($userId)
    {
        if (!$this->isLoggedIn()) {
            throw new InstagramException("You must be logged in to call unfollowUser().");
        }
        if ($userId instanceof User) {
            $userId = $userId->getPk();
        }
        $request = new DestroyFriendshipRequest($this, $userId);
        $response = $request->execute();
        if (!$response->isOk()) {
            throw new InstagramException(sprintf("Failed to unfollowUser: [%s] %s", $response->getStatus(), $response->getMessage()));
        }
        return $response;
    }