diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index 9d9624e3a9eb..8d9a875d7b23 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -247,6 +247,7 @@ class Validator implements ValidatorContract 'Prohibited', 'ProhibitedIf', 'ProhibitedUnless', + 'Prohibits', 'Same', 'Unique', ]; diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index edb9e4cdeb52..99880973fc10 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -1509,6 +1509,17 @@ public function testProhibits() $v = new Validator($trans, ['email' => 'foo', 'emails' => 'bar', 'email_address' => 'baz'], ['email' => 'prohibits:emails,email_address']); $this->assertFalse($v->passes()); $this->assertSame('The email field prohibits emails / email address being present.', $v->messages()->first('email')); + + $trans = $this->getIlluminateArrayTranslator(); + $v = new Validator($trans, [ + 'foo' => [ + ['email' => 'foo', 'emails' => 'foo'], + ['emails' => 'foo'], + ], + ], ['foo.*.email' => 'prohibits:foo.*.emails']); + $this->assertFalse($v->passes()); + $this->assertTrue($v->messages()->has('foo.0.email')); + $this->assertFalse($v->messages()->has('foo.1.email')); } public function testFailedFileUploads()