Skip to content

Stop disposable email addresses before they enter your Laravel app.

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.

README powered content

A clean way to keep throwaway inboxes out of your signup flow.

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.

110,646+disposable domains included
Laravel 10-13supported versions
Rule + Facade + Blademultiple integration points
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}
RULEFlexible validation

Block temporary inboxes with disposable_email, then opt into RFC, DNS, spoof, or filter checks when needed.

RUNTIMERuntime checks

Check email addresses anywhere in your app using the rule class or facade.

SYNCRemote syncing

Keep your domain list fresh by syncing from a remote source whenever you need to.

CACHEOptional caching

Speed up repeated lookups in busy applications with built-in cache support.

Go beyond domain matching with RFC and DNS validation.

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'
RFCRFC and strict modes

Validate supported email RFCs and optionally reject RFC warnings.

DNSMailbox domain checks

Opt into DNS lookups and require the email domain to have a valid MX record.

SPOOFUnicode spoof protection

Reject deceptive Unicode addresses using the optional spoof validator.

FILTERPHP filter modes

Choose standard or Unicode-aware filter_var validation.

Everything you need to use the package with confidence.

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.

What you get
  • A large built-in disposable domain list ready to use out of the box.
  • Support for both string rules and custom rule objects.
  • Optional RFC, strict, DNS, spoof, and filter validation modes.
  • Facade and runtime checks for service classes and business logic.
  • @disposableEmail(...) for simple conditional output in Blade views.
  • Remote syncing, custom blacklist files, and optional caching.
Where it fits best
  1. Registration forms and account creation flows.
  2. Free trial protection and abuse prevention.
  3. B2B onboarding where real business email addresses matter.
  4. Admin tools and moderation workflows.
  5. Invite, referral, and lead-quality sensitive features.

Use it the way real Laravel apps are built.

Start with validation at the request layer, then add runtime checks anywhere your business logic needs a simple yes or no answer.

Form Request
public function rules(): array{    return [        'email' => ['required', 'email', 'disposable_email'],    ];}
Facade
use Disposable;if (Disposable::email($email)) {    throw ValidationException::withMessages([        'email' => 'Use a permanent inbox.'    ]);}
Blade
@disposableEmail($email)  <p class="text-red-600">Disposable email detected</p>@else  <p class="text-green-600">Email looks good</p>@enddisposableEmail

Install it, configure it, and keep your email checks up to date.

Start with Getting Started, then move through validation, configuration, advanced RFC/DNS checks, syncing, and caching to set up a complete email validation workflow.

Frequently Asked Questions

Does this package run validation checks offline?

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.

How often are the disposable domains updated?

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.

Can I configure whitelisted domains or subdomains?

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.

Is there any lookup performance overhead?

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.

MIT License. Copyright Er Amit Gupta