Package

Propaganistas Laravel Disposable Email

Disposable email validator

Package

propaganistas/laravel-disposable-email

View on GitHub →

Laravel Disposable Email

Adds a validator to Laravel for checking whether a given email address isn't originating from disposable email services such as Mailinator, Guerillamail, ... Uses the disposable domains blacklist from disposable/disposable by default.

Installation

  1. Run the Composer require command to install the package:

    composer require propaganistas/laravel-disposable-email
    
  2. If you don't use auto-discovery, open up your app config and add the Service Provider to the $providers array:

    'providers' => [
       ...
    
       Propaganistas\LaravelDisposableEmail\DisposableEmailServiceProvider::class,
    ],
    
  3. Publish the configuration file and adapt the configuration as desired:

    php artisan vendor:publish --tag=laravel-disposable-email
    
  4. Run the following artisan command to fetch an up-to-date list of disposable domains:

    php artisan disposable:update
    
  5. (optional) In your languages directory, add for each language an extra language line for the validator:

    'indisposable' => 'Disposable email addresses are not allowed.',
    
  6. (optional) It's highly advised to update the disposable domains list regularly. You can either run the command yourself now and then or, if you make use of Laravel's scheduler, include it over there (App\Console\Kernel):

    protected function schedule(Schedule $schedule)
    {
        $schedule->command('disposable:update')->weekly();
    }
    

Usage

Use the indisposable validator to ensure a given field doesn't hold a disposable email address. You'll probably want to add it after the email validator to make sure a valid email is passed through:

'field' => 'email|indisposable',

Custom fetches

By default the package retrieves a new list by using file_get_contents(). If your application has different needs (e.g. when behind a proxy) please review the disposable-email.fetcher configuration value.

Propaganistas Laravel Disposable Email Related Articles

Prevent Disposable Email Registrations with Email Utilities for Laravel image

Prevent Disposable Email Registrations with Email Utilities for Laravel

Read article
Disposable Email Detection in Laravel image

Disposable Email Detection in Laravel

Read article
Email Sending and Testing for Laravel in One Account image

Email Sending and Testing for Laravel in One Account

Read article
Enforce the Disposal of Objects in PHP image

Enforce the Disposal of Objects in PHP

Read article
Enhance Email Validation with Laravel's Fluent Email Rule Object image

Enhance Email Validation with Laravel's Fluent Email Rule Object

Read article
Phone Number Formatting, Validation, and Model Casts in Laravel image

Phone Number Formatting, Validation, and Model Casts in Laravel

Read article

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift