For forms, you have to overide the messages method and it should return an array of attributes-rule pairs for the error message to be customized.
public function messages()
{
return [
'username.required' => 'The username field is required.',
'password.required' => 'The password field is required.',
];
}
or
$messages = [
'email.required' => 'We need to know your e-mail address!',
];
Here is what I did, bound the validator object to a variable. Got the errors, got the errors in array format, then simply pushed the array to json format and added it to messages.