propaganistas / laravel-disposable-email
Disposable email validator
Fund package maintenance!
Propaganistas
Installs: 1 328 490
Dependents: 8
Suggesters: 1
Security: 0
Stars: 482
Watchers: 15
Forks: 53
Open Issues: 0
Requires
- php: ^8.1
- ext-json: *
- illuminate/cache: ^10.0|^11.0
- illuminate/config: ^10.0|^11.0
- illuminate/console: ^10.0|^11.0
- illuminate/contracts: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- illuminate/validation: ^10.0|^11.0
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- mockery/mockery: ^1.4.2
- orchestra/testbench: *
- phpunit/phpunit: ^10.5
- dev-master
- 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: 2024-10-01 00:48:28 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
-
Run the following artisan command to fetch an up-to-date list of disposable domains:
php artisan disposable:update
-
(optional) In your languages directory, add for each language an extra language line for the validator:
'indisposable' => 'Disposable email addresses are not allowed.',
-
(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, you can register the
disposable:update
command:In
routes/console.php
:use Illuminate\Support\Facades\Schedule; Schedule::command('disposable:update')->weekly();
Or if you use Laravel 10 or below, head over to the 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.