ctf0 / EmailValidator by ctf0

validation rule to validate email for Laravel
2,432
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-12-15 15:06:47
Package Statistics
Total Downloads: 2,432
Monthly Downloads: 19
Daily Downloads: 0
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',
        ],
    ],