attla/disposable

A PHP Laravel to validate disposable emails.

Fund package maintenance!
attla

dev-main 2022-03-23 22:58 UTC

This package is auto-updated.

Last update: 2024-04-24 04:04:37 UTC


README

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.