We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af8837d commit 4fc84cdCopy full SHA for 4fc84cd
1 file changed
src/Input.php
@@ -491,7 +491,20 @@ protected function injectNotEmptyValidator()
491
*/
492
protected function prepareRequiredValidationFailureMessage()
493
{
494
- $notEmpty = new NotEmpty();
+ $chain = $this->getValidatorChain();
495
+ $validators = $chain->getValidators();
496
+
497
+ foreach ($validators as $validator) {
498
+ if ($validator['instance'] instanceof NotEmpty) {
499
+ $notEmpty = $validator['instance'];
500
+ break;
501
+ }
502
503
504
+ if (!isset($notEmpty)) {
505
+ $notEmpty = new NotEmpty();
506
507
508
$templates = $notEmpty->getOption('messageTemplates');
509
return [
510
NotEmpty::IS_EMPTY => $templates[NotEmpty::IS_EMPTY],
0 commit comments