Validates email addresses of known trashmail/temporary mail/disposable mail providers, managed by your own database, to keep away unserious registrations.
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
use TobiSchulz\TrashmailChecker\Rules\NoTrashmail;
class ValidateEmailController extends Controller
{
public function __invoke(Request $request)
{
$request->validate([
'email' => ['required', 'email', 'bail', new NoTrashmail],
]);
}
}
use TobiSchulz\TrashmailChecker\Facade\TrashmailChecker;
TrashmailChecker::check('taylor@trashmail.com');
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
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email tobias@byte.software instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.