You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a form request and define custom error message for phone rule in messages() method.
Add phone:ge rule to any field – it will display custom message in case of failed validation (correct behavior).
Now replace phone:ge rule with (new Phone)->country('ge').
Validation still works correctly, but validation.phone string will be displayed instead of custom message.
Observed vs Expected behavior
I have a Form Request where I have defined custom validation messages, including one for phone rule.
This custom validation error is displayed correctly if I add phone or phone:ge rule to field. However, untranslated validation.phone string is displayed when I add (new Phone)->country($country->code) to rules.
Translation works for both phone/phone:ge and (new Phone)->country($country->code) if I define custom error messages in global resources/lang/en/validation.php, but if i define same errors in form requests messages() method, it only works for phone and phone:ge rules, not for (new Phone)->country($country->code).
The text was updated successfully, but these errors were encountered:
@Propaganistas Next time please don't change a class' contract on a patch release. I relied on Phone::setValidator() and Phone::passes(), which were removed/changed in 2172362
Laravel-Phone version
5.3.2
Steps to reproduce
phone
rule inmessages()
method.phone:ge
rule to any field – it will display custom message in case of failed validation (correct behavior).phone:ge
rule with(new Phone)->country('ge')
.validation.phone
string will be displayed instead of custom message.Observed vs Expected behavior
I have a Form Request where I have defined custom validation messages, including one for
phone
rule.This custom validation error is displayed correctly if I add
phone
orphone:ge
rule to field. However, untranslatedvalidation.phone
string is displayed when I add(new Phone)->country($country->code)
to rules.Translation works for both
phone
/phone:ge
and(new Phone)->country($country->code)
if I define custom error messages in globalresources/lang/en/validation.php
, but if i define same errors in form requestsmessages()
method, it only works forphone
andphone:ge
rules, not for(new Phone)->country($country->code)
.The text was updated successfully, but these errors were encountered: