File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -356,8 +356,10 @@ protected function processRules(
356
356
357
357
$ param = ($ param === false ) ? '' : $ param ;
358
358
359
+ $ fieldForErrors = ($ rule === 'field_exists ' ) ? $ originalField : $ field ;
360
+
359
361
// @phpstan-ignore-next-line $error may be set by rule methods.
360
- $ this ->errors [$ field ] = $ error ?? $ this ->getErrorMessage (
362
+ $ this ->errors [$ fieldForErrors ] = $ error ?? $ this ->getErrorMessage (
361
363
($ this ->isClosure ($ rule ) || $ arrayCallable ) ? (string ) $ i : $ rule ,
362
364
$ field ,
363
365
$ label ,
Original file line number Diff line number Diff line change @@ -948,8 +948,7 @@ public function testFieldExistsErrorMessage(): void
948
948
949
949
$ this ->assertFalse ($ this ->validation ->run ($ data ));
950
950
$ this ->assertSame (
951
- // This errror message is not perfect.
952
- ['fiz.bar.baz ' => 'The fiz.*.baz field must exist. ' ],
951
+ ['fiz.*.baz ' => 'The fiz.*.baz field must exist. ' ],
953
952
$ this ->validation ->getErrors ()
954
953
);
955
954
}
You can’t perform that action at this time.
0 commit comments