ctf0 / EmailValidator by ctf0

validation rule to validate email for Laravel
1,964
16
2
Package Data
Maintainer Username: ctf0
Maintainer Contact: muah003@gmail.com (Muah)
Package Create Date: 2017-03-01
Package Last Update: 2023-01-03
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-26 03:10:06
Package Statistics
Total Downloads: 1,964
Monthly Downloads: 50
Daily Downloads: 2
Total Stars: 16
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

also check https://github.com/mailcheck/mailcheck & for vue https://github.com/ctf0/mailcheck-vue

Installation

  • composer require ctf0/email-validator

  • add the service provider to config/app.php

    'providers' => [
        ctf0\EmailValidator\MailGunValidatorServiceProvider::class,
        // ctf0\EmailValidator\EguliasValidatorServiceProvider::class,
        // ctf0\EmailValidator\ValidatorPizzaServiceProvider::class,
    ]
    

Usage

  • add the rule to the validator

    'email' => 'required|email|isValid'
    
  • add the translation keys

    'custom' => [
        // ...
        'email' => [
            'isValid' => 'This :attribute is invalid',
        ],
    ],