propaganistas / laravel-disposable-email
Disposable email validator
Package info
github.com/Propaganistas/Laravel-Disposable-Email
pkg:composer/propaganistas/laravel-disposable-email
Fund package maintenance!
Requires
- php: ^8.2
- ext-json: *
- illuminate/cache: ^12.0|^13.0
- illuminate/config: ^12.0|^13.0
- illuminate/console: ^12.0|^13.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- illuminate/validation: ^12.0|^13.0
Requires (Dev)
- laravel/pint: ^1.14
- mockery/mockery: ^1.4.2
- orchestra/testbench: *
- phpunit/phpunit: ^11.5.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 3.0.1
- 3.0.0
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.29
- 2.4.28
- 2.4.27
- 2.4.26
- 2.4.25
- 2.4.24
- 2.4.23
- 2.4.22
- 2.4.21
- 2.4.20
- 2.4.19
- 2.4.18
- 2.4.17
- 2.4.16
- 2.4.15
- 2.4.14
- 2.4.13
- 2.4.12
- 2.4.11
- 2.4.10
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.18
- 2.2.17
- 2.2.16
- 2.2.15
- 2.2.14
- 2.2.13
- 2.2.12
- 2.2.11
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.26
- 2.1.25
- 2.1.24
- 2.1.23
- 2.1.22
- 2.1.21
- 2.1.20
- 2.1.19
- 2.1.18
- 2.1.17
- 2.1.16
- 2.1.15
- 2.1.14
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-12-01 12:55:05 UTC
README
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
-
Run the Composer require command to install the package. The service provider is discovered automatically.
composer require propaganistas/laravel-disposable-email
-
Publish the configuration file and adapt the configuration as desired:
php artisan vendor:publish --tag=laravel-disposable-email
-
In your languages directory, add an extra translation in every
validation.phplanguage file:'indisposable' => 'Disposable email addresses are not allowed.',
-
(optional) This package receives a weekly patch release containing updates to the built-in disposable domains list. If you are not able to bump your installed version accordingly, or just want to stay ahead of things, make sure to update the domains list yourself at any interval you like by running or scheduling the
disposable:updatecommand:// routes/console.php use Illuminate\Support\Facades\Schedule; Schedule::command('disposable:update')->daily();
Usage
Use the indisposable validator or the Indisposable rule object to ensure a given field doesn't hold a disposable email address. The validator will reject anything that doesn't look like a valid email address, so you should combine it with the email rule:
'field' => ['email', 'indisposable'], // 'field' => ['email', new Indisposable],
MX record inspection
Disposable services rotate their public "front" domains endlessly (e.g. web-library.net) while their backend mail infrastructure stays constant (e.g. mail.tm). Because a freshly rotated front domain won't be on the list yet, it can slip through a plain domain-list check.
Enabling MX inspection closes that gap: the validator resolves the domain's MX records and flags the address when its mail servers point at a domain that's already on the list.
Simply opt in by specifying the mx parameter:
'field' => ['email', 'indisposable:mx'], // 'field' => ['email', (new Indisposable)->inspectMxRecords()],
Note: this performs a live DNS lookup during validation, trading a little latency for broader coverage. Leave off the
mxparameter if your validation path must stay strictly offline.
Configuration
The published config/disposable-email.php file allows you to customize:
sources: URLs returning JSON arrays of domains.disposable:updatefetches and combines all sources.storage: the writable path for the updated list. The bundled list is used if this file does not exist.whitelist: exact domains to remove from the disposable list.include_subdomains: also reject email subdomains of listed domains; disabled by default.cache: enable or disable caching and configure the cache store and key. The list is cached indefinitely by default.
The whitelist is applied when loading the list from storage, not to an existing cached list. After changing it, clear the configured domain cache so the list is reloaded.
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), set disposable-email.fetcher to a class implementing Propaganistas\LaravelDisposableEmail\Contracts\Fetcher. Its handle($url) method must return an array of domains.