Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Spent some couple minutes trying to hack this. So I want to share the fix! */
- //Open /vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php
- //Copy out the functions "credentials" and "username" respectively to your "LoginController.php"
- //edit the functions in the LoginController.php as thus:
- protected function credentials(Request $request)
- {
- $field = filter_var($request->input($this->username()), FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
- $request->merge([$field => $request->input($this->username())]);
- return $request->only($field, 'password');
- }
- public function username()
- {
- return 'login'; //change this to the <input name=""> of your username/email text input in login.blade.php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement