https://github.com/romanzipp/laravel-validator-pizza
⚠️ This package has been renamed
https://github.com/romanzipp/laravel-validator-pizza
disposable emails laravel php php7 showcase
Last synced: over 1 year ago
JSON representation
⚠️ This package has been renamed
- Host: GitHub
- URL: https://github.com/romanzipp/laravel-validator-pizza
- Owner: romanzipp
- License: mit
- Created: 2018-03-05T12:36:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-25T14:17:09.000Z (over 2 years ago)
- Last Synced: 2025-02-28T01:49:21.769Z (over 1 year ago)
- Topics: disposable, emails, laravel, php, php7, showcase
- Language: PHP
- Homepage: https://www.mailcheck.ai/
- Size: 42 KB
- Stars: 19
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
> # ⚠️ This package has been renamed
>
> You can find the new project at [**romanzipp/Laravel-MailCheck**](https://github.com/romanzipp/Laravel-MailCheck).
> This repository will not get any updates anymore.
# Laravel Validator.Pizza
[](https://packagist.org/packages/romanzipp/laravel-validator-pizza)
[](https://packagist.org/packages/romanzipp/laravel-validator-pizza)
[](https://packagist.org/packages/romanzipp/laravel-validator-pizza)
[](https://github.com/romanzipp/Laravel-Validator-Pizza/actions)
A Laravel Wrapper for the [Validator.pizza](https://www.validator.pizza) disposable email API made by [@tompec](https://github.com/tompec).
## Features
- Query the Validator.Pizza API for disposable Emails & Domains
- Cache responses
- Store requested domains in database
## Installation
```
composer require romanzipp/laravel-validator-pizza
```
## Configuration
Copy configuration to your project:
```
php artisan vendor:publish --provider="romanzipp\ValidatorPizza\Providers\ValidatorPizzaProvider"
```
Run the migration:
```
php artisan migrate
```
Change the config to your desired settings:
```php
return [
// Database storage enabled
'store_checks' => true,
// Database table name
'checks_table' => 'validator_pizza',
// Cache enabled (recommended)
'cache_checks' => true,
// Duration in minutes to keep the query in cache
'cache_duration' => 30,
// Determine which decision should be given if the rate limit is exceeded [allow / deny]
'decision_rate_limit' => 'allow',
// Determine which decision should be given if the domain has no MX DNS record [allow / deny]
'decision_no_mx' => 'allow',
// Makes use of the API key
'key' => env('VALIDATOR_PIZZA_KEY'),
];
```
## 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_pizza',
]);
// ...
}
}
```
#### Standalone
```php
$checker = new \romanzipp\ValidatorPizza\Checker;
// Validate Email
$validEmail = $checker->allowedEmail('ich@ich.wtf');
// Validate Domain
$validDomain = $checker->allowedDomain('ich.wtf');
```