public function confirmPetition(string $token, string $email)
    {
        $petition = $this->emailChangePetitions()
            ->unconfirmedByTokenAndEmail($token, $email)
            ->first();

        if (! is_null($petition)) {
            $petition->confirmed();
        }

        $this->email = $email;
        $this->save();
    }
public function confirmPetition(string $token, string $email)
    {
        $petition = $this->emailChangePetitions()
            ->unconfirmedByTokenAndEmail($token, $email)
            ->first();

        if (! is_null($petition)) {
            $petition->confirmed();
        }

        $this->email = $email;
        $this->save();
    }
public function confirmPetition ( string $ token , string $ email ) { $ petition = $ this -> emailChangePetitions ( ) -> unconfirmedByTokenAndEmail ( $ token , $ email ) -> first ( ) ; if ( ! is_null ( $ petition ) ) { $ petition -> confirmed ( ) ; } $ this -> email = $ email ; $ this -> save ( ) ; }
Mark a found petition by the given token and email as confirmed.

@param  string $token
@param  string $email

@return void
Mark a found petition by the given token and email as confirmed .