X

Create New Item

File Folder

X

Search Results

File "MailRules.php"

Full path: /home/orbitecv/orbite-school.orbit.et/app/Rules/MailRules.php
File size: 532 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

<?php

namespace App\Rules;

use Closure;
use Illuminate\Contracts\Validation\ValidationRule;

class MailRules implements ValidationRule
{
    /**
     * Run the validation rule.
     *
     * @param  \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString  $fail
     */
    public function validate(string $attribute, mixed $value, Closure $fail): void
    {
        if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {
                $fail('The :attribute must be a valid email address.');
            }
        }
}