Laravel Packages

Disposable Email Detection in Laravel

Published
Disposable Email Detection in Laravel image

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.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

masteringlaravel logo
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review

The latest

View all →
WhenMounted and BigInt Props in Inertia.js v3.8 image

WhenMounted and BigInt Props in Inertia.js v3.8

Read article
Postcodes for Laravel: GB Postcode Lookup and Geography Data image

Postcodes for Laravel: GB Postcode Lookup and Geography Data

Read article
Laravel 14 Adds a defaults() Method to Eloquent Models image

Laravel 14 Adds a defaults() Method to Eloquent Models

Read article
Laravel AI SDK and Laravel MCP Security Fixes: Update Now image

Laravel AI SDK and Laravel MCP Security Fixes: Update Now

Read article
Mailbox for Laravel: Preview and Test Rendered Email image

Mailbox for Laravel: Preview and Test Rendered Email

Read article
Count Worker Crashes as Job Exceptions in Laravel 13.34 image

Count Worker Crashes as Job Exceptions in Laravel 13.34

Read article