attla / disposable

🧼 A PHP Laravel to validate disposable emails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attla disposable email checker

License Latest Stable Version Total Downloads

A Laravel Wrapper for the Validator.pizza disposable email API.

Installation

composer require attla/disposable

Usage

Controller Validation

namespace App\Http\Controllers;

use Illuminate\Http\Request;

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

        // ...
    }
}

Standalone

$checker = new \Attla\Disposable\Checker;

// Validate Email
$validEmail = $checker->allowedEmail('lucas@octha.com');

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

Testing

composer test

License

This package is licensed under the MIT license © Octha.

About

🧼 A PHP Laravel to validate disposable emails

License:MIT License


Languages

Language:PHP 100.0%