Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

login with email or phone number laravel

    public function username()
    {
        $login = request()->input('username');

        if(is_numeric($login)){
            $field = 'phone';
        } elseif (filter_var($login, FILTER_VALIDATE_EMAIL)) {
            $field = 'email';
        } else {
            $field = 'username';
        }

        return $field;
    }
 
PREVIOUS NEXT
Tagged: #login #email #phone #number #laravel
ADD COMMENT
Topic
Name
5+6 =