Laravel has an excellent authentication system straight out of the box and if you use it, people who login to your app will need to use their email address. But, what if you want to have a login which requires a username instead of an email address, fortunately it is easy to change.
Find the LoginController.php
file. It should be at 'app/Http/Controllers/Auth/'
.
Add this piece of code immediately under the 'use AuthenticatesUsers;'
/** * Override the username method used to validate login * * @return string */ public function username() { return 'username'; }
Now of course you need a username column in your ‘Users‘ table for this to work but I am sure you would not be here if you did not have that already.