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

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article