2017 © Pedro Peláez
 

package l5-disposable-emails-validation

Validation of disposable e-mails for Laravel 5

image

dann95/l5-disposable-emails-validation

Validation of disposable e-mails for Laravel 5

  • Saturday, April 1, 2017
  • by thusk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 90 % Grown

The README.md

Laravel 5 Disposable E-mails Validation

This repo uses ivolo/disposable-email-domains to update the black list., (*1)

How to install?

composer require dann95/l5-disposable-emails-validation

How to use?

Add service provider in config/app.php

    [
        //...
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        // App\Providers\BroadcastServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
        Dann95\L5DisposableEmails\Providers\DisposableEmailsServiceProvider::class /* add it here */
        //...
    ],

Using inside Http/Requests

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'email' => ['required','email','real_email'],
        ];
    }

    /**
     * @return array
     */
    public function messages()
    {
        return [
            'email.real_email' => 'Sorry you are using temporary e-mail',
        ];
    }

Using inside Http/Controller

public function store(Request $request)
{
    $this->validate($request, [
        'email' => 'required|email|real_email',
    ]);
    // the email is valid
}

Using anywhere

    $validator = Validator::make(request()->all(), [
        'email' => 'required|email|real_email',
    ]);

    if ($validator->fails()) {
        // it fails
    }

The Versions

01/04 2017

dev-master

9999999-dev

Validation of disposable e-mails for Laravel 5

  Sources   Download

MIT

The Requires

 

by Daniel Rubin