LaravelPackages.net
Acme Inc.
Toggle sidebar
zanysoft/email-checker

Laravel Package To Validate If An Email Address Exists Without Sending An Email

41
0
1.0
About zanysoft/email-checker

zanysoft/email-checker is a Laravel package for laravel package to validate if an email address exists without sending an email. It currently has 0 GitHub stars and 41 downloads on Packagist (latest version 1.0). Install it with composer require zanysoft/email-checker. Discover more Laravel packages by zanysoft or browse all Laravel packages to compare alternatives.

Last updated

Validate Email for Laravel

Latest Version on Packagist Software License Total Downloads

Notice - That extracts the MX records from the email address and connect with the mail server to make sure the mail address accurately exist. So it may be slow loading time in local and some co-operate MX records take a long time.

You can install the package via composer:

composer require zanysoft/email-checker

The package will automatically register itself.

Translations

If you wish to edit the package translations, you can run the following command to publish them into your resources/lang folder

php artisan vendor:publish --provider="ZanySoft\EmailChecker\EmailCheckerServiceProvider"

Features

This package supports:

  • Validate with SMTP
  • Support for Disposable Email

Usage

Form Request Validation

To add 'email_checker' at email attribute

    // [your site path]/app/Http/Requests/RegisterRequest.php
    public function rules()
    {
        return [
               'name' => 'required|string|max:255',
               'email' => 'required|string|email|max:255|unique:users|email_checker',
               'password' => 'required|string|min:6|confirmed',
        ];
    }

In a RegisterController

    // [your site path]/app/Http/Controllers/Auth/RegisterController.php
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => ['required', 'string', 'max:255'],
            'email' => 'required|string|email|max:255|unique:users|email_checker',
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);
    }

Using Rule Objects

    use ZanySoft\EmailChecker\Rules\EmailExist;

    $request->validate([
        'email' => ['required', 'string', 'email', 'max:255', 'unique:users', new EmailExist],
    ]);

Usage With Facade

You can also check check email manually:

// reture boolean
EmailChecker::check('[email protected]');

Credit

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

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

License

The MIT License (MIT). Please see License File for more information.

Star History Chart