An open API service indexing awesome lists of open source software.

https://github.com/attla/disposable

🧼 A PHP Laravel to validate disposable emails
https://github.com/attla/disposable

attla disposable disposable-email laravel

Last synced: 3 months ago
JSON representation

🧼 A PHP Laravel to validate disposable emails

Awesome Lists containing this project

README

        

# Attla disposable email checker


License
Latest Stable Version
Total Downloads

A Laravel Wrapper for the [Validator.pizza](https://www.validator.pizza) disposable email API.

## Installation

```bash
composer require attla/disposable
```

## Usage

#### Controller Validation

```php
namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
public function handleEmail(Request $request)
{
$request->validate([
'email' => 'required|email|disposable',
]);

// ...
}
}
```

#### Standalone

```php
$checker = new \Attla\Disposable\Checker;

// Validate Email
$validEmail = $checker->allowedEmail('[email protected]');

// Validate Domain
$validDomain = $checker->allowedDomain('octha.com');
```

### Testing

```bash
composer test
```

## License

This package is licensed under the [MIT license](LICENSE) © [Octha](https://octha.com).