Change unverified email id in laravel before verification

Viewed 32

I want to change signup email which user enter incorrect during signup.I add a textbox to correct email id in verification page but when the update code is hit its show "email is not verified"

Here is the code to update unverified email id

public function updateemail($email)
{
   date_default_timezone_set('Australia/Melbourne');
$email_verified_at = date('m/d/Y h:i:s a', time());
 return DB::table('students')->where('email', $email)->update(array('email' => $email));   
}

Ajax code is here

$("#resendnew").click(function(){
        
        var email =  $('#emailnew').val();
        
         $.ajax({
                method: "POST",
                 
                url: "/register/updateemail/"+email, 
                success: function (response) {
                    
                    console.log('response',response);
                   alert("Data Updated");
                     
                },
                error:function(error){
                    console.log('err',error);
                    alert("Data Error");
                }
            });


    });
});

Here is View

0 Answers
Related