Laravel Disposable Email
A Laravel validation rule that blocks disposable and throwaway email addresses like Mailinator and Guerrillamail.
Repository Health
Technical Analysis
propaganistas/laravel-disposable-email adds an indisposable validation rule to Laravel that rejects email addresses originating from disposable or throwaway email services such as Mailinator and Guerrillamail. It uses the community-maintained disposable/disposable domain blacklist by default.
Beyond a plain domain-list check, it can optionally inspect a domain’s MX records to catch freshly rotated front domains that point at known disposable mail infrastructure. A bundled Artisan command keeps the blacklist current, and the package integrates cleanly with Laravel’s validator and caching.
What You Get
- An indisposable validation rule for rejecting throwaway email addresses
- A bundled, weekly-updated blacklist from disposable/disposable
- Optional MX-record inspection to catch newly rotated disposable domains
- A disposable:update Artisan command to refresh the domain list
- A DisposableDomains facade and configurable caching for custom checks
Common Use Cases
- Blocking disposable email addresses during user registration
- Enforcing real email addresses on newsletter or lead-capture forms
- Reducing spam and fake signups in Laravel applications
- Programmatically checking whether a domain is disposable via the facade
Under The Hood
Architecture - A DisposableEmailServiceProvider registers a DisposableDomains service (exposed via a facade) and the indisposable validator extension. DisposableDomains loads domains from a bundled domains.json, caching them through illuminate/cache, and offers an MX-inspection path that resolves DNS records. A Fetcher (DefaultFetcher) plus an UpdateDisposableDomainsCommand refresh the list from the upstream source.
Tech Stack - PHP ^8.1 with ext-json, built on Illuminate components (cache, config, contracts, support, console, validation) spanning Laravel 10 through 13. Dev tooling uses PHPUnit, Orchestra Testbench, Mockery, and Laravel Pint.
Code Quality - The code is cleanly separated into service provider, domain service, fetcher, console command, and validation extension, with a tests directory run under PHPUnit and Testbench. Active development and consistent releases (including weekly blacklist updates) reflect solid maintenance.
API Design - Usage is idiomatic Laravel: add ‘indisposable’ (optionally ‘indisposable:mx’) to a field’s validation rules and it just works, with auto-discovered service provider and a facade for programmatic checks. The optional MX flag keeps the common offline path fast while offering deeper coverage when needed.