The Disposable Email package for Laravel aims to detect and block email addresses with over 100K+ known domains. This package provides multiple ways to consume disposable email detection rules, such as a validation rule, a blade directive, and a service facade:
use EragLaravelDisposableEmail\Rules\DisposableEmailRule; $request->validate([ 'email' => ['required', 'email', new DisposableEmailRule()],]); // Or the string rule$request->validate([ 'email' => ['required', 'email', 'disposable_email'],]);
The domain detection list is configurable, and you can sync it via a provided command:
php artisan erag:sync-disposable-email-list
The source lists are configurable, and I'd encourage you to validate the listed domains. You can also add your own domains to the list. It might be ideal to copy and maintain these lists yourself or manually validate them each time you sync.
Main Features
- 106,000+ known disposable domains already included
- Smart validation rule for form requests
- Runtime email checking via helper and facade
- Blade directive support for conditionals
- Auto-sync with remote domain lists
- Add your own custom blocklist with ease
- Zero-configuration setup with publishable config
- Compatible with Laravel 8, 9, 10, 11, and 12
You can learn more about this package, get full installation instructions, and view the source code on GitHub.