Skip to content

Commit

Permalink
Allow email validator message to be replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed May 14, 2020
1 parent 81ca5d4 commit e5a7acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Validators/EmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

class EmailValidator extends RegexValidator
{
public function __construct()
public function __construct($message = 'Invalid email address')
{
parent::__construct(
'/^[_a-zA-Z0-9+\-]+(\.[_a-zA-Z0-9+\-]+)*@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(\.[a-zA-Z]{2,})$/',
'invalid email address'
$message
);
}
}

0 comments on commit e5a7acb

Please sign in to comment.