| Package Data | |
|---|---|
| Maintainer Username: | eramitgupta |
| Maintainer Contact: | info.eramitgupta@gmail.com (Er Amiit Gupta) |
| Package Create Date: | 2025-04-18 |
| Package Last Update: | 2025-12-10 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2026-01-02 15:00:04 |
| Package Statistics | |
|---|---|
| Total Downloads: | 60,245 |
| Monthly Downloads: | 12,070 |
| Daily Downloads: | 499 |
| Total Stars: | 202 |
| Total Watchers: | 2 |
| Total Forks: | 14 |
| Total Open Issues: | 0 |
A Laravel package to detect and block disposable (temporary) email addresses during validation or runtime logic.
Already contains 110,646+ disposable email domains! ๐ฅ
composer require erag/laravel-disposable-email
Ensure the service provider is registered in your /bootstrap/providers.php file:
use EragLaravelDisposableEmail\LaravelDisposableEmailServiceProvider;
return [
// ...
LaravelDisposableEmailServiceProvider::class,
];
Ensure the service provider is registered in your config/app.php file:
'providers' => [
// ...
EragLaravelDisposableEmail\LaravelDisposableEmailServiceProvider::class,
],
Publish the config file:
php artisan erag:install-disposable-email
This will create config/disposable-email.php.
$request->validate([
'email' => 'required|email|disposable_email',
]);
$request->validate([
'email' => ['required', 'email', 'disposable_email'],
]);
use EragLaravelDisposableEmail\Rules\DisposableEmailRule;
$request->validate([
'email' => ['required', 'email', new DisposableEmailRule()],
]);
use EragLaravelDisposableEmail\Rules\DisposableEmailRule;
if (DisposableEmailRule::isDisposable('test@tempmail.com')) {
// Do something if email is disposable
}
Or via facade:
use DisposableEmail;
if (DisposableEmail::isDisposable('agedmail.com')) {
// Do something
}
@disposableEmail('amit@0-mail.com')
<p class="text-red-600">Disposable email detected!</p>
@else
<p class="text-green-600">Valid email.</p>
@enddisposableEmail
Update the list manually
php artisan erag:sync-disposable-email-list
return [
'blacklist_file' => storage_path('app/blacklist_file),
'remote_url' => [
'https://raw.githubusercontent.com/eramitgupta/disposable-email/main/disposable_email.txt',
],
'cache_enabled' => false,
'cache_ttl' => 60,
];
โ Note: The
.txtfiles fromremote_urlmust follow this format:
Each line should contain only a domain name, like:
0-00.usa.cc
0-30-24.com
0-attorney.com
0-mail.com
00-tv.com
00.msk.ru
00.pe
00000000000.pro
000728.xyz
000777.info
00082cc.com
00082dd.com
00082ss.com
If the file contains anything other than plain domains (like comments or extra data), it may cause parsing issues.
โ Want to block additional disposable domains?
You can easily extend the list manually โ no coding, no command required!
| Step | Action |
|------|--------|
| ๐น 1 | Go to the following path: storage/app/blacklist_file/ |
| ๐น 2 | Create or edit this file: disposable_domains.txt |
| ๐น 3 | Add your custom domains like:abakiss.comfakemail.orgtrashbox.io(one per line) |
๐ Important Notes:
Your file path must match the one defined in config/disposable-email.php:
'blacklist_file' => storage_path('app/blacklist_file'),
If the path or filename is different, the package will not load your custom list.
This package supports optional caching to improve performance, especially when dealing with large domain lists.
To enable caching, update the config file config/disposable-email.php:
'cache_enabled' => true,
'cache_ttl' => 60,
If you manually update the domain list and want to clear the cache, you can use:
php artisan cache:clear