think.studio/laravel-email-domain is a Laravel package for check email domain..
It currently has 0 GitHub stars and 19 downloads on Packagist (latest version 1.1.0).
Install it with composer require think.studio/laravel-email-domain.
Discover more Laravel packages by think.studio
or browse all Laravel packages to compare alternatives.
Last updated
Install the package via composer:
composer require think.studio/laravel-email-domain
You can publish the config and assets files with:
php artisan vendor:publish --provider="EmailDomain\ServiceProvider" --tag="config"
php artisan vendor:publish --provider="EmailDomain\ServiceProvider" --tag="storage"
Example usage:
EmailDomainChecker::setDomainsFilePath('path/to.file')->isDomainInList('gmail.com');
EmailDomainChecker::usePublicProviderDomainsFile()->isDomainInList('gmail.com');
$email = '[email protected]';
EmailDomainChecker::usePublicProviderDomainsFile()->isDomainInList(Str::afterLast($email, '@'));
EmailDomainChecker::usePublicProviderDomainsFile()->isEmailDomainInList($email);
// You can add your own groups in config `email-domain.domains_group_files` to check other groups
Trait usage:
class User extends Model
{
use HasEmailDomainChecker;
}
$user->email = '[email protected]';
$user->getEmailProviderDomain(); // gmail.com
$user->hasPublicEmailProviderDomain(); // true