Answers for "exists password and confirm password validation in laravel"

PHP
0

how to make validate error when password doesnt match with password confirm laravel

// ...

$input = Input::all();

$rules = [
    'password' => 'required|min:8',
    'password_confirmation' => 'required|min:8|same:password',
];

$messages = [
    'password_confirmation.same' => 'Password Confirmation should match the Password',
];
$validator = Validator::make($input, $rules, $messages);

if ($validator->fails()) {
    return back()->withInput()->withErrors($validator->messages());
}
// ...
Posted by: Guest on October-19-2021
12

confirm password validation laravel

'password' => 'required|confirmed',

reference : https://laravel.com/docs/4.2/validation#rule-confirmed

The field under validation must have a matching field of foo_confirmation. 
For example, if the field under validation is password, a matching
password_confirmation field must be present in the input.
Posted by: Guest on August-02-2020

Code answers related to "exists password and confirm password validation in laravel"

Browse Popular Code Answers by Language