I have model, and it has several field names, and 'lastName' is among them.
In my FormRequest file, I have rules and messages for this field:
$rules = ['lastName.*' => 'lastName_fail: index'];
$messages = ['lastName.*lastName_fail' => This lastName has different value in DB!'];
When I am submitting a form, filling the 'lastName' field with intentionally 'wrong' value, it doesn't pass validation, and returns error message:
validation.last_name_fail
(which is not what's in $messages).
But when I change $rules and $messages to:
$rules = ['lastName.*' => 'lastname_fail: index'];
$messages = ['lastName.*lastname_fail' => This lastName has different value in DB!'];
(so the actual "rule" is now lowercase "lastname_fail"), it outputs what i want:
This lastName has different value in DB!
from this I may conclude that Laravel's validation rule name may be only lowercase.
Is it declared anywhere in documentation?
If so, maybe it helps someone.