PHPackages                             jtn/laravel-validate-email-domain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. jtn/laravel-validate-email-domain

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

jtn/laravel-validate-email-domain
=================================

Validates email addresses belong to the given domain

v1.1.0(8y ago)3181Apache-2.0PHP

Since Oct 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jonathanjanssens/laravel-validate-email-domain)[ Packagist](https://packagist.org/packages/jtn/laravel-validate-email-domain)[ RSS](/packages/jtn-laravel-validate-email-domain/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel Email Domain Validation
===============================

[](#laravel-email-domain-validation)

Validation rule for Laravel 5.5 to validate that a given email address belongs to the provided domain.

Wildcard domains and multiple domains are supported.

Basic Usage
-----------

[](#basic-usage)

If your class implements the Laravel `ValidatesRequests` trait you can validate a simple domain as follows.

```
use Jtn\EmailDomain;

$this->validate(request()->all(), [
    'email' => ['email', new EmailDomain('example.com')]
])

```

This validation rule will only pass if the email provided is `@example.com`.

Wildcard Usage
--------------

[](#wildcard-usage)

```
$this->validate(request()->all(), [
    'email' => ['email', new EmailDomain('*.example.com')]
])

```

This rule wil match any of `mail.example.com`, `test.example.com`, etc. To match `mail.test.example.com` the rule must be `new EmailDomain('*.*.example.com')`.

Match Multiple Domains
----------------------

[](#match-multiple-domains)

To match multiple domains simply pass an array of accepted domains to the constructor. You can pass any number of domains and wildcards as an array to check them all.

```
$this->validate(request()->all(), [
    'email' => [
        'email',
        new EmailDomain(['example.org', 'example.com'])
    ]
])

```

Strict Mode
-----------

[](#strict-mode)

Strict mode can be disabled to match wildcard domains. This is useful if you would like to match all subdomains under `example.com`.

The following example will match `example.com` domains and any length of subdomains under it.

```
$domainRule = new EmailDomain(['example.com', ['*.example.com']]);
$this->validate(request()->all(), [
    'email' => ['email', $domainRule->nonStrict()]
])

```

### Changelog

[](#changelog)

### 1.1.0

[](#110)

- Add support for strict matching

### 1.0.0

[](#100)

- Initial release, support for simple domains and wildcard

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

3126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8baf1ad5f6c5a44a7c3def28cc79fbbe6024b000af35800b6188ffc53e6548e1?d=identicon)[jtn](/maintainers/jtn)

---

Top Contributors

[![jonathanjanssens](https://avatars.githubusercontent.com/u/3079607?v=4)](https://github.com/jonathanjanssens "jonathanjanssens (5 commits)")

---

Tags

domainemaillaravellaravel-validationphpvalidatorlaravelvalidatorvalidationemailemail domain

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jtn-laravel-validate-email-domain/health.svg)

```
[![Health](https://phpackages.com/badges/jtn-laravel-validate-email-domain/health.svg)](https://phpackages.com/packages/jtn-laravel-validate-email-domain)
```

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[kartik-v/yii2-validators

Enhanced Yii2 model validator components / utilities for Yii2 Framework

21137.9k](/packages/kartik-v-yii2-validators)[kouz/laravel-mailgun-email-validation

Laravel email validation that uses the Mailgun API for a three-step validation check.

11141.0k1](/packages/kouz-laravel-mailgun-email-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
