2017 © Pedro Peláez
 

library laravel-email-validator

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

image

dossierdata/laravel-email-validator

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

  • Wednesday, March 21, 2018
  • by lucasvdh
  • Repository
  • 1 Watchers
  • 2 Stars
  • 232 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 49 % Grown

The README.md

A more extensive email validator than the default provided by Laravel., (*1)

Laravel Email Validator

Latest Stable Version Build Status Total Downloads StyleCI Software License, (*2)

The Laravel Email Validator extends the Laravel Validator with the validate_email rule., (*3)

How do I install it?

The easiest way is via Composer., (*4)

To install the latest version of Laravel Email Validator, run the command below:, (*5)

composer require dossierdata/laravel-email-validator

Then register the service provider in config/app.php:, (*6)

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

Requirements

  • Laravel 5.0 and up

How do I use it?

There are currently four different rules that you can choose from:, (*7)

  • rfc - Validates that the supplied value complies with RFC 5321 and RFC 5322
  • 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:, (*8)

<?php

// Rule without parameters will default to only checking RFC
$validator = \Validator::make([
    'email' => '.incorrect@email.nodomain'
], [
    'email' => 'validate_email',
]);

if ($validator->fails()) {
    dump($validator->errors());
}

// Rule with parameters
$validator = \Validator::make([
    'email' => '.incorrect@email.nodomain'
], [
    'email' => 'validate_email:rfc,spf:127.0.0.1,dns',
]);

if ($validator->fails()) {
    dump($validator->errors());
}

Use via dependency injection:, (*9)

<?php

$rules = [
    'rfc',
    'spf:127.0.0.1',
    'dns'
];

$emailValidator = app(\Dossierdata\LaravelEmailValidator\Contracts\EmailValidator::class);

if (!$emailValidator->validateValue('.incorrect@email.nodomain', $rules)) {
    dump($emailValidator->errors());
}

Contributing

See the CONTRIBUTING guidelines for this project., (*10)

License

The dossierdata/laravel-email-validator is open-sourced software licensed under the MIT license., (*11)

The Versions

21/03 2018

dev-development

dev-development

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

  Sources   Download

MIT

The Requires

 

The Development Requires

21/03 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

21/03 2018
21/03 2018

v1.0.1

1.0.1.0

Reader for csv files

  Sources   Download

MIT

The Requires

 

The Development Requires

21/03 2018

v1.0.0

1.0.0.0

Reader for csv files

  Sources   Download

MIT

The Requires

 

The Development Requires