yaroslawww / laravel-email-domain
This package is abandoned and no longer maintained.
The author suggests using the think.studio/laravel-email-domain package instead.
Check email domain.
1.1.0
2023-07-09 11:16 UTC
Requires
- php: ^8.0
- illuminate/support: ^8.0|^9.0|^10.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.20
- orchestra/testbench: ^8.5
- phpunit/phpunit: ^10.2
- psalm/plugin-laravel: ^2.8
- vimeo/psalm: ^5.13
This package is auto-updated.
Last update: 2023-07-09 11:35:10 UTC
README
Installation
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"
Usage
Example usage:
EmailDomainChecker::setDomainsFilePath('path/to.file')->isDomainInList('gmail.com');
EmailDomainChecker::usePublicProviderDomainsFile()->isDomainInList('gmail.com');
$email = 'test@gmail.com';
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 = 'test@gmail.com';
$user->getEmailProviderDomain(); // gmail.com
$user->hasPublicEmailProviderDomain(); // true