问题
I am using cviebrock for validating image size in laravel. And thats working fine. But I want to customize the error message.
I created an array of message
$messages = array(
'image-size' => 'My custome message.',
);
and passed to
$validation = Validator::make(array($file => $fileObj), array($file => $rules), $messages);
But thats not working.
-Thanks Arun
回答1:
You're using the wrong name, it should be with an underline, like
$messages = array(
'image_size' => 'My custome message.',
);
来源:https://stackoverflow.com/questions/27520121/how-to-pass-custom-validation-message-to-cviebrock-image-validator-in-laravel