Skip to content

All topics  /  Laravel

Laravel 7/6 Password & Password_Confirmation Validation

Laravel ·

Laravel 7/6 Password & Password_Confirmation Validation

Hi Guys,

In this example,I will learn you to give password and password_confirmation validation in laravel 7/6.you can simply use to validation in laravel 7/6.

we want to match password and confirm password using this validation. you will check password and password_confirmation then 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
}

It will help you....