laravel-email-validator maintained by equipc
Description
Validation rule to validate email for Laravel
Author
Last update
2025/09/24 22:41
(dev-master)
License
Downloads
445
Laravel Email Validator
Validate email addresses in Laravel 7.x
Installation
- The package could be installed via Composer
composer require equipc/laravel-email-validator
- Publish the configuration file using the command below
php artisan vendor:publish --provider="EquiPC\EmailValidator\EmailValidatorServiceProvider" --tag="config"
- Configure your Quick Email Verification key in your
.envfile. You can retrieve this API key from the Quick Email Verification control panel.
QUICKEMAILVERIFICATION_KEY=your-api-key
Usage
- add the
isValidEmailrule to the validator
'email' => 'required|email|isValidEmail'
Customizing the error message
If you want to modify the error message, you can publish the lang files with this command:
php artisan vendor:publish --provider="EquiPC\EmailValidator\EmailValidatorServiceProvider" --tag="lang"
This will publish this file to resources/lang/vendor/emailValidator/en/validation.php.
return [
"is_invalid_email" => "This email is invalid.",
];
If you want to translate the values to, for example, French, just copy that file over to resources/lang/vendor/emailValidator/fr/validation.php and fill in the French translations.
Sandbox mode
You can enable sandbox mode in your .env file
QUICKEMAILVERIFICATION_SANDBOX=true