GithubHelp home page GithubHelp logo

tijeers / laravel-disposable-email Goto Github PK

View Code? Open in Web Editor NEW

This project forked from propaganistas/laravel-disposable-email

0.0 0.0 0.0 5.99 MB

Disposable email address validator for Laravel

PHP 100.00%

laravel-disposable-email's Introduction

Laravel Disposable Email

Tests Latest Stable Version Total Downloads License

Adds a validator to Laravel for checking whether a given email address isn't originating from disposable email services such as Mailinator, Guerillamail, ... Uses the disposable domains blacklist from disposable/disposable by default.

Installation

  1. Run the Composer require command to install the package:

    composer require propaganistas/laravel-disposable-email
  2. If you don't use auto-discovery, open up your app config and add the Service Provider to the $providers array:

    'providers' => [
       ...
    
       Propaganistas\LaravelDisposableEmail\DisposableEmailServiceProvider::class,
    ],
  3. Publish the configuration file and adapt the configuration as desired:

    php artisan vendor:publish --tag=laravel-disposable-email
  4. Run the following artisan command to fetch an up-to-date list of disposable domains:

    php artisan disposable:update
  5. (optional) In your languages directory, add for each language an extra language line for the validator:

    'indisposable' => 'Disposable email addresses are not allowed.',
  6. (optional) It's highly advised to update the disposable domains list regularly. You can either run the command yourself now and then or, if you make use of Laravel's scheduler, include it over there (App\Console\Kernel):

    protected function schedule(Schedule $schedule)
    {
        $schedule->command('disposable:update')->weekly();
    }

Usage

Use the indisposable validator to ensure a given field doesn't hold a disposable email address. You'll probably want to add it after the email validator to make sure a valid email is passed through:

'field' => 'email|indisposable',

Custom fetches

By default the package retrieves a new list by using file_get_contents(). If your application has different needs (e.g. when behind a proxy) please review the disposable-email.fetcher configuration value.

laravel-disposable-email's People

Contributors

propaganistas avatar faytekin avatar kitro avatar lucacerretani avatar tohtamysh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.