LaravelPackages.net
Acme Inc.
Toggle sidebar
square-bit/laravel-eva

Keep fake or disposable emails out. A validation rule for your forms.

13
1
1.2
About square-bit/laravel-eva

square-bit/laravel-eva is a Laravel package for keep fake or disposable emails out. a validation rule for your forms.. It currently has 1 GitHub stars and 13 downloads on Packagist (latest version 1.2). Install it with composer require square-bit/laravel-eva. Discover more Laravel packages by square-bit or browse all Laravel packages to compare alternatives.

Last updated

Laravel Email Validation

Latest Stable Version License Total Downloads

Laravel package for integration with e-va.io service. Provides a Rule to automatically validate form emails.

Install

composer require square-bit/laravel-eva

The package will automatically register its service provider.

To publish the default config at config/eva.php:

php artisan vendor:publish --provider="Squarebit\EVA\EVAServiceProvider" --tag="config"

Make sure you update the .env file with a valid API Key (generate one at e-va.io)

|Variables|Default value| |---|---| |EVA_APIKEY|null| |EVA_SERVICE_UNAVAILABLE|true| |EVA_UNKOWN|false| |EVA_INVALID|false| |EVA_RISKY|false| |EVA_SAFE|true|

Usage

You can now use EVA to validate any email provided by your users directly with the Laravel Validator.

Let's say you're already validating an email on its basic properties

    return Validator::make($data, [
        [...]
        'email' => ['required', 'string', 'email', 'max:255'],
        [...]
    ]);

To get the email validated simply add the EVAValidated class to the list of rules:

use Squarebit\EVA\Rules\EVAValidated

[...]

    return Validator::make($data, [
        [...]
        'email' => [new EVAValidated, 'required', 'string', 'email', 'max:255', 'unique:users'],
        [...]
    ]);

That's it !

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Star History Chart