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(
356356
357357 $ param = ($ param === false ) ? '' : $ param ;
358358
359+ $ fieldForErrors = ($ rule === 'field_exists ' ) ? $ originalField : $ field ;
360+
359361 // @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 (
361363 ($ this ->isClosure ($ rule ) || $ arrayCallable ) ? (string ) $ i : $ rule ,
362364 $ field ,
363365 $ label ,
Original file line number Diff line number Diff line change @@ -948,8 +948,7 @@ public function testFieldExistsErrorMessage(): void
948948
949949 $ this ->assertFalse ($ this ->validation ->run ($ data ));
950950 $ 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. ' ],
953952 $ this ->validation ->getErrors ()
954953 );
955954 }
You can’t perform that action at this time.
0 commit comments