LaravelPackages.net
Acme Inc.
Toggle sidebar
think.studio/laravel-email-domain

Check email domain.

19
0
1.1.0
About think.studio/laravel-email-domain

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

Check email domain.

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

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 = '[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

Credits

  • Think Studio

Star History Chart