<?php

namespace App\Providers;

use Aman\EmailVerifier\EmailChecker;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;

class CheckEmailValidatorServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
      Validator::extend('checkEmail', function ($attribute, $value, $parameters, $validator) {
        $emailChecker = new EmailChecker();
        return $emailChecker->checkDomain($value);
      });
    }
}
