Thursday, May 10, 2018

I want to update login with username or email in laravel - development

I want to update login with username or email in laravel

I have updated laravel default make:Auth to Login with both username and email.
I just have override username function in

loginController.php to:

public function username()
    {
        $loginType = request()->input('username');
        $this->username = filter_var($loginType , FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
        request()->merge([$this->username => $loginType]);
        $this->property_exists($this, 'username') ? $this->username : 'email';
    }

but got an error:

Method [property_exists] does not exist on [AppHttpControllersAuthLoginController].



from Laravel Questions and Answers https://laravelquestions.com/php/i-want-to-update-login-with-username-or-email-in-laravel/
via Lzo Media

No comments:

Post a Comment