Skip to content

Commit 7294996

Browse files
committed
error messages to translations
1 parent 6dea61a commit 7294996

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/CardCvc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CardCvc implements Rule
1818
*/
1919
protected $card_number;
2020

21-
public function __construct(string $card_number)
21+
public function __construct($card_number)
2222
{
2323
$this->message = static::MSG_CARD_CVC_INVALID;
2424
$this->card_number = $card_number;
@@ -48,6 +48,6 @@ public function passes($attribute, $value)
4848
*/
4949
public function message()
5050
{
51-
return $this->message;
51+
return trans($this->message);
5252
}
5353
}

src/CardExpirationDate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ public function passes($attribute, $value)
6161
*/
6262
public function message()
6363
{
64-
return $this->message;
64+
return trans($this->message);
6565
}
6666
}

src/CardExpirationMonth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CardExpirationMonth implements Rule
2020
*
2121
* @param string $year
2222
*/
23-
public function __construct(string $year)
23+
public function __construct($year)
2424
{
2525
$this->year = $year;
2626
}
@@ -46,6 +46,6 @@ public function passes($attribute, $value)
4646
*/
4747
public function message()
4848
{
49-
return static::MSG_CARD_EXPIRATION_MONT_INVALID;
49+
return trans(static::MSG_CARD_EXPIRATION_MONT_INVALID);
5050
}
5151
}

src/CardExpirationYear.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CardExpirationYear implements Rule
2020
*
2121
* @param string $month
2222
*/
23-
public function __construct(string $month)
23+
public function __construct($month)
2424
{
2525
$this->month = $month;
2626
}
@@ -46,6 +46,6 @@ public function passes($attribute, $value)
4646
*/
4747
public function message()
4848
{
49-
return static::MSG_CARD_EXPIRATION_YEAR_INVALID;
49+
return trans(static::MSG_CARD_EXPIRATION_YEAR_INVALID);
5050
}
5151
}

src/CardNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public function passes($attribute, $value)
5050
*/
5151
public function message()
5252
{
53-
return $this->message;
53+
return trans($this->message);
5454
}
5555
}

0 commit comments

Comments
 (0)