PHPackages                             gigabooksite/laravel-email-domain-blacklist - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. gigabooksite/laravel-email-domain-blacklist

Abandoned → [https://github.com/full-scale-teams/laravel-email-domain-blacklist](/?search=https%3A%2F%2Fgithub.com%2Ffull-scale-teams%2Flaravel-email-domain-blacklist)Library[Validation &amp; Sanitization](/categories/validation)

gigabooksite/laravel-email-domain-blacklist
===========================================

A Laravel package for adding email domain blacklist validation rule

2.0.2(11mo ago)1102MITPHPPHP ^7.2|^8.0

Since Dec 6Pushed 11mo ago4 watchersCompare

[ Source](https://github.com/full-scale-teams/laravel-email-domain-blacklist)[ Packagist](https://packagist.org/packages/gigabooksite/laravel-email-domain-blacklist)[ RSS](/packages/gigabooksite-laravel-email-domain-blacklist/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Laravel Email Domain Blacklist
==============================

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

[![Build Status](https://camo.githubusercontent.com/7f6a252be3abfb29e74f00ea7c0cbccedb18a54fc80a2a8882dd9326289c7aca/68747470733a2f2f7472617669732d63692e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alariva/laravel-email-domain-blacklist)[![Maintainability](https://camo.githubusercontent.com/e5384c1f7ba77a2e88cea09e6f23b39f34406203bb3f28f82432b6166a8bfb13/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31303531616464666666663433333634393033302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/alariva/laravel-email-domain-blacklist/maintainability)[![Test Coverage](https://camo.githubusercontent.com/2d65cf714c70af1d7c8f65a947b1ab23fd9a27c88ddf2146238c4e28600a8605/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31303531616464666666663433333634393033302f746573745f636f766572616765)](https://codeclimate.com/github/alariva/laravel-email-domain-blacklist/test_coverage)[![Latest Stable Version](https://camo.githubusercontent.com/b388b6706f8f9a5fc35e673652d6d41c96130d6adea2ba2f1b355a550a3d44b5/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/alariva/laravel-email-domain-blacklist)[![Total Downloads](https://camo.githubusercontent.com/064e7debe40268de284b2dc7cf4f8a6a1622fb30a1e849cad5e0474a29edbe0f/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/alariva/laravel-email-domain-blacklist)[![Latest Unstable Version](https://camo.githubusercontent.com/acd7f68d88fad3abce2abb95ed674481acdd8222e0fe32ddfebdaa21f4ae8da8/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742f762f756e737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/alariva/laravel-email-domain-blacklist)[![License](https://camo.githubusercontent.com/66fa9118f373baba7e6082c17b28d6476a1d3c34143e8077cbe1f00a1eaffdac/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/alariva/laravel-email-domain-blacklist)[![Monthly Downloads](https://camo.githubusercontent.com/faf37cf20f8a747e2a908d7bb84202f25eed0db7ff4c2c691af18e6befee2a1a/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742f642f6d6f6e74686c793f666f726d61743d666c6174)](https://packagist.org/packages/alariva/laravel-email-domain-blacklist)[![composer.lock](https://camo.githubusercontent.com/9eed76f9c246677d045f45c8d02b04eb19b4e085a88e3f0c835d0637fec4ffca/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742f636f6d706f7365726c6f636b3f666f726d61743d666c6174)](https://packagist.org/packages/alariva/laravel-email-domain-blacklist)[![FOSSA Status](https://camo.githubusercontent.com/9a4121ecf6bc8f415fcb2d331625678f0e91f3d52c0db2903656dc68880d3f12/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616c61726976612532466c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Falariva%2Flaravel-email-domain-blacklist?ref=badge_shield)

Validate email input that it's not blacklisted for a specific domain name.

[![](https://camo.githubusercontent.com/6f91104859a42ab8d1169de605e61e7b9c5c481f6cb1ce343c78e8d220e7c78f/68747470733a2f2f692e696d6775722e636f6d2f746e306b7673352e706e67)](https://camo.githubusercontent.com/6f91104859a42ab8d1169de605e61e7b9c5c481f6cb1ce343c78e8d220e7c78f/68747470733a2f2f692e696d6775722e636f6d2f746e306b7673352e706e67)

Usage
-----

[](#usage)

Add `blacklist` to the validation rules string.

```
  public function store(Request $request) {

      $this->validate($request,
        ['email' => 'required|email|blacklist']
      );

  }
```

Installation
============

[](#installation)

Require this package with composer:

```
composer require alariva/laravel-email-domain-blacklist

```

This package uses *AutoDiscovery*.

If you are using Laravel &lt;= 5.4 manually add the Service Provider to the providers array in `config/app.php`

```
Alariva\EmailDomainBlacklist\EmailDomainBlacklistServiceProvider::class,
```

Publish the package config:

```
php artisan vendor:publish --provider="Alariva\EmailDomainBlacklist\EmailDomainBlacklistServiceProvider" --tag=config

```

Documentation
=============

[](#documentation)

Laravel Email Domain Blacklist is a lightweight package that extends your validation rules with `blacklist`.

You may pass a local or remote JSON file containing all the blacklisted email domains, usually disposable email services.

If you use a third-party remote list, you may also append your custom email domains.

You may update the cached list with the console command (manually or scheduled).

An auto-update option is available if you don't want to run the command and prefer to auto-update on the first validation.

The validation message translation is available in English and Spanish; feel free to PR your translation.

### Laravel validator

[](#laravel-validator)

```
public function store(Request $request) {
    $this->validate($request,
      ['email' => 'required|email|blacklist']
    );
}
```

Configuration
-------------

[](#configuration)

### source: string|null

[](#source-stringnull)

You may specify the preferred URL or file path to update the blacklist.

Keep `null` if you don't want to use a remote source.

Default: `https://raw.githubusercontent.com/ivolo/disposable-email-domains/master/index.json`

### cache-key: string|null

[](#cache-key-stringnull)

You may change the cache key for the sourced blacklist.

Keep `null` if you want to use the default value.

### auto-update: true|false

[](#auto-update-truefalse)

Specify if it should automatically get the source when the cache is empty.

**ADVICE:** This may slow down the first request upon validation.

Default: `false`

### append: string|null

[](#append-stringnull)

You may use a string of pipe `|` separated domains list.

Keep `null` if you don't want to append custom domains.

**Example:** `example.com|example.net|foobar.com`.

Updating the blacklist with command
-----------------------------------

[](#updating-the-blacklist-with-command)

Manually updating the cached blacklist:

```
php artisan blacklist:update-email-domains

```

It's OK if you run this command after deployment and refresh it on a weekly/monthly basis.

Scheduling the cached blacklist update (example):

```
    // app/Console/Kernel.php @schedule

    // ...
    $schedule->command('blacklist:update-email-domains')
             ->monthly()
             ->sundays()
             ->at('05:00')
             ->withoutOverlapping()
             ->sendOutputTo(storage_path('logs/email-domains-blacklist.txt'));
    // ...
```

Overriding translation
----------------------

[](#overriding-translation)

Add the JSON translation key to your project core translations, which will override the package validation message.

[More info on overriding translation](https://github.com/laravel/framework/pull/20599#issue-136044259)

Testing
=======

[](#testing)

```
vendor/bin/phpunit

```

Projects using this package
===========================

[](#projects-using-this-package)

I built this package to offload some code in my application [Fimedi NET](https://www.fimedi.net), a clinical nutrition control app for dietitians and patients.

ToDo
====

[](#todo)

- Update the project lexicon to avoid the use of offensive terms.

Contributing
============

[](#contributing)

Please try to follow the psr-2 coding style guide.

Credits
=======

[](#credits)

This package was inspired [on this great post by Matt Kingshott](https://medium.com/@mattkingshott/laravel-validation-rule-block-disposable-email-blacklisted-domains-949cab9c59fe)

- [Ariel Vallese](https://www.linkedin.com/in/alariva/)
- [Ilya Volodarsky](https://github.com/ivolo/) for maintenance of [disposable email domains repo](https://github.com/ivolo/disposable-email-domains)
- At symbol icon made by [Gregor Cresnar](https://www.flaticon.com/authors/gregor-cresnar) from [www.flaticon.com](http://www.flaticon.com)

Package alternatives
====================

[](#package-alternatives)

- [Laravel-Email-Domain-Validation - madeITBelgium](https://github.com/madeITBelgium/Laravel-Email-Domain-Validation)
- [Laravel Email Domain Validation - jonathanjanssens](https://github.com/jonathanjanssens/laravel-validate-email-domain)

License
=======

[](#license)

[MIT](https://opensource.org/licenses/MIT)

[![FOSSA Status](https://camo.githubusercontent.com/87353bd457198cb760c010cdfb87532be2e7ed65bcd2aa33ab300f0a1f2c995c/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616c61726976612532466c61726176656c2d656d61696c2d646f6d61696e2d626c61636b6c6973742e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Falariva%2Flaravel-email-domain-blacklist?ref=badge_large)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.4% 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 ~177 days

Total

4

Last Release

357d ago

Major Versions

1.0.0 → 2.0.02024-08-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6dcdf62f0fb5df57e12165302e68465486ea0d36ec0177e98ba293abf8c9151?d=identicon)[rocks\_assets](/maintainers/rocks_assets)

---

Top Contributors

[![alariva](https://avatars.githubusercontent.com/u/3021314?v=4)](https://github.com/alariva "alariva (43 commits)")[![ctberdon](https://avatars.githubusercontent.com/u/9564339?v=4)](https://github.com/ctberdon "ctberdon (6 commits)")[![devstack-be](https://avatars.githubusercontent.com/u/20860547?v=4)](https://github.com/devstack-be "devstack-be (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")[![kyranb](https://avatars.githubusercontent.com/u/5426926?v=4)](https://github.com/kyranb "kyranb (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![lempa](https://avatars.githubusercontent.com/u/929798?v=4)](https://github.com/lempa "lempa (1 commits)")[![nonovd](https://avatars.githubusercontent.com/u/12936673?v=4)](https://github.com/nonovd "nonovd (1 commits)")[![sky93](https://avatars.githubusercontent.com/u/8404511?v=4)](https://github.com/sky93 "sky93 (1 commits)")[![tserencio-fs](https://avatars.githubusercontent.com/u/78344709?v=4)](https://github.com/tserencio-fs "tserencio-fs (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

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