Skip to content

Commit cf84819

Browse files
Merge pull request #5 from TheDragonCode/1.x
Laravel: Fixed validation message
2 parents 1464a1a + 345f4b2 commit cf84819

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Laravel/Validation/Rules/CardNumberRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function throwType(Closure $fail): void
5252

5353
protected function throwCard(Closure $fail): void
5454
{
55-
$fail('The :attribute must be a valid card number.')->translate();
55+
$fail('The :attribute field must be a valid card number.')->translate();
5656
}
5757

5858
protected function isInvalidType(bool|CardType|null $type): bool

tests/Unit/Laravel/Validation/Rules/CardNumberRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
it('must be a invalid card number with enum', function () {
3232
expect(
3333
fn () => validateRule(CardNumberRule::class, '2131 1356 1381 3510', CardType::visa)
34-
)->toThrow(Exception::class, 'The :attribute must be a valid card number.');
34+
)->toThrow(Exception::class, 'The :attribute field must be a valid card number.');
3535
});
3636

3737
it('must be a invalid card number with string', function () {
3838
expect(
3939
fn () => validateRule(CardNumberRule::class, '2131 1356 1381 3510', 'visa')
40-
)->toThrow(Exception::class, 'The :attribute must be a valid card number.');
40+
)->toThrow(Exception::class, 'The :attribute field must be a valid card number.');
4141
});
4242

4343
it('should check for the valid card type', function () {

0 commit comments

Comments
 (0)