tobischulz/trashmail-checker

Validates email addresses of known trashmail providers to keep away untrusted registrations.

1.2.0 2021-07-15 11:02 UTC

This package is auto-updated.

Last update: 2024-10-15 18:08:10 UTC


README

Latest Version on Packagist Total Downloads

Validates email addresses of known trashmail/temporary mail/disposable mail providers, managed by your own database, to keep away unserious registrations.

Installation

You can install the package via composer:

composer require tobischulz/trashmail-checker

Publish all required assets:

php artisan vendor:publish --provider=TobiSchulz\TrashmailChecker\TrashmailCheckerServiceProvider

Migrate your database:

php artisan migrate

Usage

Validation Rule

use TobiSchulz\TrashmailChecker\Rules\NoTrashmail;

class ValidateEmailController extends Controller
{
    public function __invoke(Request $request)
    {
        $request->validate([
            'email' => ['required', 'email', 'bail', new NoTrashmail],
        ]);
    }
}

Facade

use TobiSchulz\TrashmailChecker\Facade\TrashmailChecker;

TrashmailChecker::check('taylor@trashmail.com');

Configuration

TrashmailChecker would let you disable the email check in development (env= local) by setting key TRASHMAIL_IN_DEVELOPMENT to false in your .env file.

TRASHMAIL_IN_DEVELOPMENT=false

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email tobias@byte.software instead of using the issue tracker.

Credits

License

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