EragLaravelDisposableEmail helps you detect and block temporary email addresses during form validation, runtime checks, and Blade conditionals. It comes with 110,646+ known disposable domains, simple installation, remote sync support, custom blacklist support, optional RFC/DNS validation, and caching for faster lookups.
Whether you are protecting registrations, trial signups, invite systems, or internal tools, this package gives you a simple Laravel-friendly API for rejecting disposable email domains before they become a data quality problem.
composer require erag/laravel-disposable-emailphp artisan erag:install-disposable-email$request->validate([ 'email' => ['required', 'email', 'disposable_email'],]);if (Disposable::email($email)) { // stop temp inboxes early}
Block temporary inboxes with disposable_email, then opt into RFC, DNS, spoof, or filter checks when needed.
Check email addresses anywhere in your app using the rule class or facade.
Keep your domain list fresh by syncing from a remote source whenever you need to.
Speed up repeated lookups in busy applications with built-in cache support.
Preview how the validation experience feels inside a Laravel app. Red highlights invalid or disposable addresses, while green shows an email that passes the check.
Applying the disposable email validation rule before the form can continue.
$request->validate([
'email' => ['required', 'email', 'disposable_email'],
]);
Email checked: name@example.com
Domain: pending...
Status: Checking email policy Add one or more optional validation modes after the rule. The plain disposable_email rule keeps its original domain-only behavior.
'disposable_email:rfc''disposable_email:dns''disposable_email:rfc,dns'
Validate supported email RFCs and optionally reject RFC warnings.
Opt into DNS lookups and require the email domain to have a valid MX record.
Reject deceptive Unicode addresses using the optional spoof validator.
Choose standard or Unicode-aware filter_var validation.
The docs cover the full package workflow, from installation and validation rules to runtime checks, RFC/DNS modes, Blade directives, syncing, custom blacklists, and caching.
@disposableEmail(...) for simple conditional output in Blade views.Start with validation at the request layer, then add runtime checks anywhere your business logic needs a simple yes or no answer.
public function rules(): array{ return [ 'email' => ['required', 'email', 'disposable_email'], ];}
use Disposable;if (Disposable::email($email)) { throw ValidationException::withMessages([ 'email' => 'Use a permanent inbox.' ]);}
@disposableEmail($email) <p class="text-red-600">Disposable email detected</p>@else <p class="text-green-600">Email looks good</p>@enddisposableEmail
Start with Getting Started, then move through validation, configuration, advanced RFC/DNS checks, syncing, and caching to set up a complete email validation workflow.
Yes. The package ships with a pre-downloaded database of over 110,000+ known disposable domains stored locally, allowing checks to execute instantly at validation layer without making slow external HTTP API requests.
You can sync and refresh the local list of disposable domains at any time by running the php artisan disposable:sync command. This command fetches the newest updates directly from trusted remote repositories.
Absolutely. You can define dynamic whitelisted domains directly in your config/disposable-email.php settings. Whitelisted domains will bypass checking to prevent false positives for company-specific testing addresses.
No. Lookups are executed as simple array-key searches. For highly active registration forms, you can configure the cache settings in the configuration to keep domain checks stored in memory for optimal speed.