Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tobischulz/trashmail-checker
Validates email addresses of known trashmail providers to keep away untrusted registrations.
https://github.com/tobischulz/trashmail-checker
disposable-emails email-validation laravel rule trashmail validation
Last synced: about 1 month ago
JSON representation
Validates email addresses of known trashmail providers to keep away untrusted registrations.
- Host: GitHub
- URL: https://github.com/tobischulz/trashmail-checker
- Owner: tobischulz
- Created: 2019-11-20T11:49:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-15T11:03:01.000Z (over 3 years ago)
- Last Synced: 2024-10-13T03:22:11.818Z (2 months ago)
- Topics: disposable-emails, email-validation, laravel, rule, trashmail, validation
- Language: PHP
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Trashmail Checker
[![Latest Version on Packagist](https://img.shields.io/packagist/v/tobischulz/trashmail-checker.svg?style=flat-square)](https://packagist.org/packages/tobischulz/trashmail-checker)
[![Total Downloads](https://img.shields.io/packagist/dt/tobischulz/trashmail-checker.svg?style=flat-square)](https://packagist.org/packages/tobischulz/trashmail-checker)Validates email addresses of known trashmail/temporary mail/disposable mail providers, managed by your own database, to keep away unserious registrations.
## Installation
You can install the package via composer:
```bash
composer require tobischulz/trashmail-checker
```Publish all required assets:
```bash
php artisan vendor:publish --provider=TobiSchulz\TrashmailChecker\TrashmailCheckerServiceProvider
```Migrate your database:
```bash
php artisan migrate
```## Usage
### Validation Rule
``` php
use TobiSchulz\TrashmailChecker\Rules\NoTrashmail;class ValidateEmailController extends Controller
{
public function __invoke(Request $request)
{
$request->validate([
'email' => ['required', 'email', 'bail', new NoTrashmail],
]);
}
}
```### Facade
``` php
use TobiSchulz\TrashmailChecker\Facade\TrashmailChecker;TrashmailChecker::check('[email protected]');
```### Configuration
TrashmailChecker would let you disable the email check in development (env= local) by setting key ```TRASHMAIL_IN_DEVELOPMENT``` to ```false``` in your .env file.
```
TRASHMAIL_IN_DEVELOPMENT=false
```### Testing
``` bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Tobias Schulz](https://github.com/:tobischulz)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.