kisaw88
257
7
Laravel

how to change user status to unverified email

Posted 2 months ago by kisaw88

hello, i'am writing a PATCH request to the users table here is the code

$user = User::where('email',$email)->get()->first();
    $user->Type_compte=request('Type_compte');
    $user->district=request('district');
    $user->cds=request('cds');
    if($user->email!=request('email')){
    $user->email=request('email');
    $user->email_verified_at='NULL';
    }
    $user->password=Hash::make(request('password'));

    $user->save();
    return redirect('/comptes');

,when the email gets changed i want to make sure that the user verifies the the new email , how do i do it ?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.