PHPackages                             dossierdata/laravel-email-validator - 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. dossierdata/laravel-email-validator

ActiveLibrary

dossierdata/laravel-email-validator
===================================

A more extensive email validator rule than the default provided by Laravel.

4.0.0(7mo ago)610.7k↑12.5%2[1 issues](https://github.com/dossierdata/laravel-email-validator/issues)MITPHPPHP ^8.2CI failing

Since Mar 21Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/dossierdata/laravel-email-validator)[ Packagist](https://packagist.org/packages/dossierdata/laravel-email-validator)[ RSS](/packages/dossierdata-laravel-email-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (12)Used By (0)

A more extensive email validator than the default provided by Laravel.

Laravel Email Validator
=======================

[](#laravel-email-validator)

[![Latest Stable Version](https://camo.githubusercontent.com/74f6e83da125bbd4c5de2b734efaacf793d4946e7432cc93c52fcfb83afc53d1/68747470733a2f2f706f7365722e707567782e6f72672f646f7373696572646174612f6c61726176656c2d656d61696c2d76616c696461746f722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/dossierdata/laravel-email-validator)[![Build Status](https://camo.githubusercontent.com/a555fc3771e5d46b7f07774384337e7b00ced79abe91dc904ec70d04bacd90da/68747470733a2f2f7472617669732d63692e6f72672f646f7373696572646174612f6c61726176656c2d656d61696c2d76616c696461746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dossierdata/laravel-email-validator)[![Total Downloads](https://camo.githubusercontent.com/e9ae0904c810281f1d4347fd4c853eff78203b7affeeb620c3e84a5efabac1f2/68747470733a2f2f706f7365722e707567782e6f72672f646f7373696572646174612f6c61726176656c2d656d61696c2d76616c696461746f722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/dossierdata/laravel-email-validator)[![StyleCI](https://camo.githubusercontent.com/720ddf2920215a91f3582cd9bde251575670c884e6f466b10ca236785726ccea/68747470733a2f2f7374796c6563692e696f2f7265706f732f39393234393738332f736869656c64)](https://styleci.io/repos/99249783)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

The Laravel Email Validator extends the Laravel Validator with the `validate_email` rule.

How do I install it?
--------------------

[](#how-do-i-install-it)

The easiest way is via [Composer](https://getcomposer.org/).

To install the latest version of Laravel Email Validator, run the command below:

```
composer require dossierdata/laravel-email-validator

```

Then register the service provider in `config/app.php`:

```
'providers' => [
    ...
    Dossierdata\LaravelEmailValidator\ServiceProvider::class,
    Dossierdata\LaravelEmailValidator\BootServiceProvider::class,
],

```

Requirements
------------

[](#requirements)

- Laravel 5.0 and up

How do I use it?
----------------

[](#how-do-i-use-it)

There are currently four different rules that you can choose from:

- `rfc` - Validates that the supplied value complies with [RFC 5321](https://tools.ietf.org/html/rfc5321) and [RFC 5322](https://tools.ietf.org/html/rfc5322)
- `rfc_no_warning` - Same as the previous rule but will fail on warning
- `spf:127.0.0.1` - Validate that the domain of the email has a correct SPF record and that the supplied IP-address/range is authorized for this domain
- `dns` - Validates that the domain of the email actually exists by checking for an MX or DSN record

Use is as a rule for Validator:

```
