Download the PHP package erag/laravel-disposable-email without Composer
On this page you can find all versions of the php package erag/laravel-disposable-email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download erag/laravel-disposable-email
More information about erag/laravel-disposable-email
Files in erag/laravel-disposable-email
Package laravel-disposable-email
Short Description A Laravel package to detect and block disposable email addresses.
License MIT
Informations about the package laravel-disposable-email
Laravel Disposable Email Detection
A Laravel package to detect and block disposable (temporary) email addresses during validation or runtime logic.
Already contains 106,580+ disposable email domains! ๐ฅ
โ Features
- ๐ฅ 106,000+ known disposable domains already included
- ๐ง Smart validation rule for form requests
- โ๏ธ Runtime email checking via helper and facade
- ๐งฉ Blade directive support for conditionals
- ๐ Auto-sync with remote domain lists
- ๐ Add your own custom blacklist with ease
- ๐ง Optional caching for performance
- โก๏ธ Zero-configuration setup with publishable config
-
โ Compatible with Laravel 10, 11, and 12
๐ Installation
Register the Service Provider
For Laravel (Optional) v11.x, v12.x
Ensure the service provider is registered in your /bootstrap/providers.php
file:
For Laravelv v10.x
Ensure the service provider is registered in your config/app.php
file:
๐ Configuration
Publish the config file:
This will create config/disposable-email.php
.
โ Usage
1. Form Request Validation
โ Custom Rule:
โ String-based Rule:
2. Direct Runtime Check
Or via facade:
3. Blade Directive
๐ Sync From Remote (Optional)
Update the list manually
๐ Config Options (config/disposable-email.php)
โ Note: The
.txt
files fromremote_url
must follow this format:
Each line should contain only a domain name, like:
If the file contains anything other than plain domains (like comments or extra data), it may cause parsing issues.
๐งฉ Add Your Own Disposable Domains
โ 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.com fakemail.org trashbox.io (one per line) |
๐ Important Notes:
- Each line must contain only the domain name โ no extra symbols, no comments.
- The package will automatically detect and use the domains from this file.
- You do not need to run any Artisan command. ๐งโโ๏ธ
โ๏ธ Ensure File Path Matches Configuration
Your file path must match the one defined in config/disposable-email.php
:
If the path or filename is different, the package will not load your custom list.
๐ง Caching Support (Optional)
This package supports optional caching to improve performance, especially when dealing with large domain lists.
๐ง How It Works
- If enabled, the package will cache the compiled list of disposable domains for faster lookup.
- This is useful in high-traffic applications where the same list is accessed frequently.
๐ Enable Caching
To enable caching, update the config file config/disposable-email.php
:
๐งน Clear Cached List
If you manually update the domain list and want to clear the cache, you can use:
All versions of laravel-disposable-email with dependencies
laravel/pint Version ^1.13
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/validation Version ^10.0|^11.0|^12.0
illuminate/translation Version ^10.0|^11.0|^12.0
illuminate/filesystem Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0