Home Laravel Password & Password_Confirmation Validation in laravel

Password & Password_Confirmation Validation in laravel

by Shahriar Sagor
Password & Password_Confirmation Validation in laravel

Hi Dev’s, Today now in this example, I will share with you how to give password and password_confirmation validation in laravel application. So we can simply do this by using to validation in laravel application.

So we want to match given password and also confirm password by using this validation. Now we will check password and password_confirmation then we need to use below solution.

Solution :-

/**
* The attributes that are mass assignable.
*
* @var array
*/
public function store(Request $request)
{
    $input = $request->all();

    $validator = $request->validate([
            'email' => 'email',
            'vat_number' => 'max:13',
            'password' => 'required|confirmed|min:6',
	]);

    // Write Logic
}

Read also : How To Set Bcc And Cc Mail Address In Laravel Mail?

I hope it will help you. Also you can follow us on Facebook

close

You may also like