PHP code example of martynasbakanas / php-disposable-emails
1. Go to this page and download the library: Download martynasbakanas/php-disposable-emails library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
martynasbakanas / php-disposable-emails example snippets
...
use MartynasBakanas\PHPDisposableEmails\EmailCheck;
public function register(): void
{
...
$this->app->singleton('email-check', function () {
return new EmailCheck();
});
}
public function boot(): void
{
...
Validator::extend('not-disposable', function ($attribute, $value, $parameters) {
return app('email-check')->isValid($value);
});
}
public function store(Request $request)
{
$request->validate([
'email' => [
'
],
];
...
}
bash
composer