8000 [12.x] Fix email rule helper message (#57323) · laravel/framework@95fc3d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95fc3d0

Browse files
authored
[12.x] Fix email rule helper message (#57323)
* test: update to correct expectation * refactor: remove string check
1 parent f2396a7 commit 95fc3d0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Illuminate/Validation/Rules/Email.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,6 @@ public function passes($attribute, $value)
186186
{
187187
$this->messages = [];
188188

189-
if (! is_string($value) && ! (is_object($value) && method_exists($value, '__toString'))) {
190-
return false;
191-
}
192-
193189
$validator = Validator::make(
194190
$this->data,
195191
[$attribute => $this->buildValidationRules()],

tests/Validation/ValidationEmailRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public function testBasic()
3737
$this->fails(
3838
Email::default(),
3939
12345,
40-
[Email::class]
40+
['The '.self::ATTRIBUTE_REPLACED.' must be a valid email address.']
4141
);
4242

4343
$this->fails(
4444
Rule::email(),
4545
12345,
46-
[Email::class]
46+
['The '.self::ATTRIBUTE_REPLACED.' must be a valid email address.']
4747
);
4848

4949
$this->passes(

0 commit comments

Comments
 (0)
0