Last active
April 2, 2019 07:07
-
-
Save fatkulnurk/1bdae9019851877c848ff0ee38e192a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In LoginController, Overide method username. | |
| #Documentation | |
| in input('login'); , change key with key name in your login form. | |
| public function username() | |
| { | |
| $login = request()->input('login'); | |
| $fieldType = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'username'; | |
| request()->merge([$fieldType => $login]); | |
| return $fieldType; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment