Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Array Validation Message Value

For array validation messages, is there a way to display the value as opposed to the attribute? Doing so without using a custom validator.

Example:

$messages = [
   ‘*' => ':value is invalid.’
]

This would output something like "email@address is invalid".

Thanks for your help!

like image 561
bmclachlin Avatar asked Dec 14 '22 07:12

bmclachlin


1 Answers

In case anyone is still looking with the latest of Laravel versions, the answer is to use the :input parameter in your message output:

'between' => 'The :attribute value :input is not between :min - :max.'

Docs: https://laravel.com/docs/5.7/validation#custom-error-messages

like image 193
orim181 Avatar answered Jan 07 '23 04:01

orim181