If you would like the :attribute portion of your validation message to be replaced with a custom attribute name, you may specify the custom name in the attributes array of your resources/lang/xx/validation.php
某些状况下,您可能希望在语言包文件中设定您的自定义消息,而非直接将他们传递给Validator。要达到目的,将您的信息增加至app/lang/xx/validation.php文件的custom数组中。 'custom'=>array( 'email'=>array( 'required'=>'We need to know your e-mail address!', ...
您可以在应用程序的验证语言文件中自定义用于指定属性和规则组合的错误消息。为此,请将消息自定义项添加到应用程序的 lang/xx/validation.php 语言文件的 custom 数组中:'custom' => [ 'email' => [ 'required' => 'We need to know your email address!', 'max' => 'Your email address is too long!
If you would like the :attribute placeholder of your validation message to be replaced with a custom attribute name, you may specify the custom names by overriding the attributes method. This method should return an array of attribute / name pairs:...
The generated message will be “The date of birth field is required” instead of “The dob field is required”.Custom validation messageTo bypass Laravel’s validation message and replace it with your own, you can use the message: parameter in the #[Rule] attribute:use Livewire\Attributes\...
你可以在应用程序的验证语言文件中自定义用于指定属性和规则组合的错误消息。为此,请将消息自定义项添加到应用程序的 resources/lang/xx/validation.php 语言文件的 custom 数组中:'custom' => [ 'email' => [ 'required' => 'We need to know your email address!', 'max' => 'Your email address is ...
'custom' => [ 'attribute-name' => [ 'rule-name' => 'custom-message', ], ],/* |--- | Custom Validation Attributes |--- | | The following language lines are used to swap attribute place-holders | with something more reader friendly such as E-Mail Address instead | ...
可以在应用程序的验证语言文件中自定义用于指定属性和规则组合的错误信息。将自定义信息添加到应用程序的 lang/xx/validation.php 语言文件的 custom 数组中:'custom' => [ 'email' => [ 'required' => 'We need to know your email address!', 'max' => 'Your email address is too long!' ], ],...
'custom'=> ['email'=> ['required'=>'We need to know your e-mail address!', ], ], 在PHP 文件中指定自定义属性 如果你希望将验证信息的:attribute部分替换为自定义属性名称,你可以在resources/lang/xx/validation.php语言文件的attributes数组中指定自定义名称: ...
在大多数情况下,您可能会在文件中指定自定义信息,而不是直接将它们传递给 Validator 。为此,需要把你的信息放置于 resources/lang/xx/validation.php 语言文件内的 custom 数组中。 'custom' => [ ...