Polyscope - The agent-first dev environment for Laravel

Laravel Disposable Email

propaganistas/laravel-disposable-email image

Laravel Disposable Email stats

Downloads
810.6K
Stars
388
Open Issues
1
Forks
43

View on GitHub →

Disposable email validator

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.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


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
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
PhpStorm logo

PhpStorm

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

PhpStorm
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Shift logo

Shift

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

Shift
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search