Search
 
SCRIPT & CODE EXAMPLE
 

PHP

best custom email validation rule for laravel

<?php

namespace AppRules;

use IlluminateContractsValidationRule;


class EmailRule implements Rule
{
    /**
     * Create a new rule instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Determine if the validation rule passes.
     *
     * @param  string  $attribute
     * @param  mixed  $value
     * @return bool
     */
    public function passes($attribute, $value)
    {
        return filter_var($value, FILTER_VALIDATE_EMAIL);
    }

    /**
     * Get the validation error message.
     *
     * @return string
     */
    public function message()
    {
        return 'The email format is invalid.';
    }
}
Comment

laravel email validation

'email' => 'email:rfc,dns'
Comment

PREVIOUS NEXT
Code Example
Php :: php random number 
Php :: to enable php in apache 
Php :: call satic blco in magento 2 
Php :: magento 2 select to string 
Php :: php huruf besar di awal 
Php :: wp large medium large 
Php :: symfony request type 
Php :: REFERRER CODEIGNITER 3 
Php :: kill php-fpm inside docker 
Php :: php reload after env 
Php :: How to create routes in the codeigniter 
Php :: php file date created older than 
Php :: laravel migration drop foreign keys 
Php :: include navbar or part in layout in laravel blade template 
Php :: make php website https 
Php :: symfony auto decode json request 
Php :: check if config exist laravel 
Php :: php date now 
Php :: warning: parameter 2 to search_by_title() expected to be a reference, value given inwp-includesclass-wp-hook.php on line 287 
Php :: php initialize two dimensional array dynamically 
Php :: text to sha256 converter in laravel 
Php :: laravel collection forPage 
Php :: woocommerce_recently_viewed 
Php :: Dynamic Carousel in Laravel not working displays only one image 
Php :: guzzlehttp http_errors get 
Php :: php ternary string 
Php :: cors header ‘access-control-allow-origin’ missing IN PARTICULAR CAKEPHP API 
Php :: laravel make api resource 
Php :: difference between array_merge and + 
Php :: add filter in wordpress 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =