1. Go to this page and download the library: Download nilanjan-k/tempmailblocker 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/ */
nilanjan-k / tempmailblocker example snippets
use Illuminate\Foundation\Http\FormRequest;
class RegisterRequest extends FormRequest
{
public function rules(): array
{
return [
'email' => ['
use NilanjanK\TempMailBlocker\Rules\Indisposable;
$request->validate([
'email' => ['
use NilanjanK\TempMailBlocker\Rules\Indisposable;
$request->validate([
'email' => [
' ],
]);
use TempMailBlocker;
if (TempMailBlocker::isDisposable($email)) {
// handle rejection
}
if (TempMailBlocker::isIndisposable($email)) {
// proceed normally
}
use NilanjanK\TempMailBlocker\Facades\TempMailBlocker;
TempMailBlocker::isDisposable('[email protected]'); // true
TempMailBlocker::isIndisposable('[email protected]'); // true
TempMailBlocker::count(); // e.g. 19 000+
use Illuminate\Support\Facades\Schedule;
Schedule::command('tempmailblocker:update')->daily();
protected function schedule(Schedule $schedule): void
{
$schedule->command('tempmailblocker:update')->daily();
}