public function makePetitionFor($new_email)
    {
        $petition = $this->emailChangePetitions()
            ->unconfirmedByEmail($new_email)
            ->first();

        if (! is_null($petition)) {
            $petition->refresh();
            return $petition->fresh();
        }

        return $this->emailChangePetitions()->create([
            'expires_at' => \Carbon\Carbon::now()->addMonth(),
            'old_email' => $this->email,
            'new_email' => $new_email,
            'token' => str_random(60),
        ]);
    }
public function makePetitionFor($new_email)
    {
        $petition = $this->emailChangePetitions()
            ->unconfirmedByEmail($new_email)
            ->first();

        if (! is_null($petition)) {
            $petition->refresh();
            return $petition->fresh();
        }

        return $this->emailChangePetitions()->create([
            'expires_at' => \Carbon\Carbon::now()->addMonth(),
            'old_email' => $this->email,
            'new_email' => $new_email,
            'token' => str_random(60),
        ]);
    }
public function makePetitionFor ( $ new_email ) { $ petition = $ this -> emailChangePetitions ( ) -> unconfirmedByEmail ( $ new_email ) -> first ( ) ; if ( ! is_null ( $ petition ) ) { $ petition -> refresh ( ) ; return $ petition -> fresh ( ) ; } return $ this -> emailChangePetitions ( ) -> create ( [ 'expires_at' => \ Carbon \ Carbon :: now ( ) -> addMonth ( ) , 'old_email' => $ this -> email , 'new_email' => $ new_email , 'token' => str_random ( 60 ) , ] ) ; }
Make a new email change petition with the given data.

@param  array $data

@return self
Make a new email change petition with the given data .