Level 46
Pass the custom messages as a third argument to the validator factory.
[
'email.required' => 'Your custom message here'
]
https://laravel.com/docs/5.5/validation#custom-error-messages
Hi,
I'm trying to get error messages in Lumen to work. So far I have a validator instance that checks the JSON input.
$validator = Validator::make($request->json()->all(), [ /* rules */]);
if ($validator->fails()) {
return response()->json($validator->errors(), 400);
}
However this returns error messages such as:
{
"email": [
"validation.required"
]
}
How can I change the validation.required to something like 'The email is required' as is the default in the Laravel framework I believe.
Thanks in advance! Dirk.
Please or to participate in this conversation.