Hello. My password confirmation doesn't work in form submission. Can you helpme.
My code is-
class ResetPassword extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'password' => 'required|min:8',
'password_confirmation' => 'required',
];
}
}
@tisuchi Yeah, but it doesn't matter, because they have to match. And password is required which means if you don't fill password_confirmation field than confimed validation rule fail.
Differentiating between the "password" and the "password confirmation" should be possible. Telling the user that registration failed because the password doesn’t meet the minimum security requirements is quite different from telling them that the password confirmation don’t match. It would be ideal to display the validation error message next to the password field when it doesn’t meet the requirements, and show the confirmation mismatch error message below the confirmation field when the password meets the minimum requirements but the confirmation doesn’t match. I can’t do this if the password requirements and the password confirmation are treated as the same thing.