Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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());
}
// ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validate #error #password #doesnt #match #password #confirm #laravel
ADD COMMENT
Topic
Name
5+8 =