I\'ve been using this in order to edit the User Account Info:
$this->validate($request, [
\'password\' => \'min:6\',
\'password_confirmation\'
try confirmed and without password_confirmation rule:
$this->validate($request, [
'name' => 'required|min:3|max:50',
'email' => 'email',
'vat_number' => 'max:13',
'password' => 'confirmed|min:6',
]);
I have used in this way.. Working fine!
$inputs = request()->validate([
'name' => 'required | min:6 | max: 20',
'email' => 'required',
'password' => 'required| min:4| max:7 |confirmed',
'password_confirmation' => 'required| min:4'
]);
Try doing it this way, it worked for me:
$this->validate($request, [
'name' => 'required|min:3|max:50',
'email' => 'email',
'vat_number' => 'max:13',
'password' => 'min:6|required_with:password_confirmation|same:password_confirmation',
'password_confirmation' => 'min:6'
]);`
Seems like the rule always has the validation on the first input among the pair...
Try this:
'password' => 'required|min:6|confirmed',
'password_confirmation' => 'required|min:6'
You can use the confirmed validation rule.
$this->validate($request, [
'name' => 'required|min:3|max:50',
'email' => 'email',
'vat_number' => 'max:13',
'password' => 'required|confirmed|min:6',
]);
It should be enough to do:
$this->validate($request, [
'password' => 'sometimes,min:6,confirmed,required_with:password_confirmed',
]);
Make password optional, but if present requires a password_confirmation that matches, also make password required only if password_confirmed is present