Skip to content

Commit 4220162

Browse files
committed
fix translate attribute in rules
1 parent 9748c9c commit 4220162

20 files changed

+10
-37
lines changed

src/Rules/IranianBankCardNumber.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
5353
! $this->isValidCardNumber(preg_replace("/{$separator}/", '', $value))
5454
) {
5555
$fail(Helper::translationKey($failMessage))->translate([
56-
'attribute' => $attribute,
5756
'separator' => Helper::translateSpaceSeparator($separator),
5857
]);
5958
}

src/Rules/IranianCompanyId.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
5454
if (! preg_match('/^(?!(\d)\1{10}$)[0-9]{11}$/', $value) ||
5555
! $this->isValidCompanyId($value)
5656
) {
57-
$fail(Helper::translationKey('ir_company_id'))->translate([
58-
'attribute' => $attribute,
59-
]);
57+
$fail(Helper::translationKey('ir_company_id'))->translate();
6058
}
6159
}
6260

src/Rules/IranianIban.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
6868
! $this->isValidIban(preg_replace("/{$separator}/", '', $value))
6969
) {
7070
$fail(Helper::translationKey($failMessage))->translate([
71-
'attribute' => $attribute,
7271
'separator' => Helper::translateSpaceSeparator($separator),
7372
]);
7473
}

src/Rules/IranianMobile.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
100100

101101
if (! preg_match("/^{$pattern}$/i", $value)) {
102102
$fail(Helper::translationKey($failMessages[$this->format]))->translate([
103-
'attribute' => $attribute,
104103
'example' => $examples[$this->format],
105104
]);
106105
}

src/Rules/IranianNationalId.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
5353
if (! preg_match('/^(?!(\d)\1{9}$)[0-9]{10}$/', $value) ||
5454
! $this->isValidNationalCode($value)
5555
) {
56-
$fail(Helper::translationKey('ir_national_id'))->translate([
57-
'attribute' => $attribute
58-
]);
56+
$fail(Helper::translationKey('ir_national_id'))->translate();
5957
}
6058
}
6159

src/Rules/IranianPhone.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
108108

109109
if (! preg_match("/^{$pattern}$/i", $value)) {
110110
$fail(Helper::translationKey($failMessage))->translate([
111-
'attribute' => $attribute,
112111
'example' => $example,
113112
]);
114113
}

src/Rules/IranianPhoneAreaCode.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
5151

5252
if (! in_array($value, Helper::getIranianPhoneAreaCodes(), true)) {
5353
$fail(Helper::translationKey('ir_phone_area_code'))->translate([
54-
'attribute' => $attribute,
5554
'example' => '021',
5655
]);
5756
}

src/Rules/IranianPostalCode.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
5353

5454
if (! preg_match("/\b(?!(\d)\1{3})[13-9]{5}{$separator}[0-9]{5}\b/", $value)) {
5555
$fail(Helper::translationKey($failMessage))->translate([
56-
'attribute' => $attribute,
5756
'separator' => Helper::translateSpaceSeparator($separator),
5857
]);
5958
}

src/Rules/PersianAlpha.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ class PersianAlpha implements ValidationRule
2929
public function validate(string $attribute, mixed $value, Closure $fail): void
3030
{
3131
if (! preg_match('/^[\p{Arabic}\x{200C}\s،؛؟!٬٫()«»٪]+$/u', (string) $value) || preg_match('/[0-9۰-۹٠-٩]/u', (string) $value)) {
32-
$fail(Helper::translationKey('persian_alpha'))->translate([
33-
'attribute' => $attribute
34-
]);
32+
$fail(Helper::translationKey('persian_alpha'))->translate();
3533
}
3634
}
3735
}

src/Rules/PersianAlphaEngNum.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ class PersianAlphaEngNum implements ValidationRule
1010
{
1111
/**
1212
* Run the validation rule.
13-
*
13+
*
1414
* Persian Alpha with English Numbers (Persian Letters and Persian/English Numbers) validation:
15-
*
15+
*
1616
* Validates:
1717
* - Letters: Persian alphabet
1818
* - Numbers: Both Persian (۰-۹) and English (0-9) numerals
1919
* - Special: Persian diacritics
2020
* - Space: Regular space and ZWNJ
21-
*
21+
*
2222
* Examples:
2323
* - Basic: سلام123
2424
* - Mixed: Hello سلام 123۴۵۶
@@ -31,9 +31,7 @@ class PersianAlphaEngNum implements ValidationRule
3131
public function validate(string $attribute, mixed $value, Closure $fail): void
3232
{
3333
if (! preg_match('/^[\p{Arabic}\x{200C}\s0-9،؛؟!٬٫()«»٪]+$/u', (string) $value)) {
34-
$fail(Helper::translationKey('persian_alpha_eng_num'))->translate([
35-
'attribute' => $attribute
36-
]);
34+
$fail(Helper::translationKey('persian_alpha_eng_num'))->translate();
3735
}
3836
}
3937
}

0 commit comments

Comments
 (0)