DEV Community

Er Amit Gupta
Er Amit Gupta

Posted on

πŸ›‘οΈ Say Goodbye to Spam: The Best Laravel Package for Disposable Email Detection

Building a great product is hard. Dealing with thousands of fake user accounts is even harder. If you’ve ever looked at your user database and seen emails like user@10minutemail.com or spam@trashmail.org, you know the frustration.

Temporary emails ruin your analytics, destroy your email deliverability, and abuse your free trials. That is why I built Laravel Disposable Email Detectionβ€”the ultimate shield for your Laravel applications.


πŸ’Ž Why This is the Best Package for the Job

There are many ways to block emails, but this package is designed to be the most comprehensive and developer-friendly tool available.

πŸ”₯ 1. Massive Database: 110,646+ Domains Included

Most validation rules only block a few hundred common domains. This package comes pre-loaded with an industry-leading list of 110,646+ known disposable domains. From the moment you run composer require, your app is protected by one of the largest blacklists on the market.

⚑ 2. Built for Performance (Caching)

Checking a list of 110k+ domains could slow down your signup process if done poorly. Our package includes Smart Caching support. Once the list is loaded, lookups happen in milliseconds, ensuring your user experience remains lightning-fast.

πŸ”„ 3. Auto-Sync: Never Go Out of Date

Spammers create new domains every single day. With a built-in Artisan command, you can automatically sync your local list with remote sources to stay protected against the latest temporary email providers.

πŸ› οΈ 4. Developer Experience (DX)

Whether you are a fan of clean controllers, custom rules, or Blade templates, we’ve got you covered:

  • Validation: Just add disposable_email to your rules.
  • Blade: Use @disposableEmail to show/hide UI elements.
  • Facade: Check emails anywhere in your logic with DisposableEmail::isDisposable().

πŸš€ Getting Started in 60 Seconds

Step 1: Install

composer require erag/laravel-disposable-email

Enter fullscreen mode Exit fullscreen mode

Step 2: Validate

In your RegisterController or FormRequest:

$request->validate([
    'email' => 'required|email|disposable_email',
]);

Enter fullscreen mode Exit fullscreen mode

That’s it! Your application is now rejecting fake emails and keeping your database clean.


🎯 The Bottom Line

Don't let fake accounts mess up your business growth. Use a tool that is powerful, updated, and easy to use.

With 110,646+ domains blocked out of the box, this is the only protection your Laravel app needs.

Star the project on GitHub:

πŸ‘‰ eramitgupta/laravel-disposable-email

Top comments (0)