After I recently upgraded Laravel from 5.2 to 5.3, I cannot login in to my app.
For a simple login I receive:
BadMethodCallException
in app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php line 82
with the message:
Method [username] does not exist
I see the cause is from ThrottlesLogins
. If I remove the Trait called ThrottlesLogins
from my AuthController
it will work.
The method [username]
is from the ThrottlesLogins
Trait at
protected function throttleKey(Request $request)
{
return Str::lower($request->input($this->username())).'|'.$request->ip();
}
The two default authentication controllers provided with the framework have been split into four smaller controllers. This change provides cleaner, more focused authentication controllers by default. The easiest way to upgrade your application to the new authentication controllers is to grab a fresh copy of each controller from GitHub and place them into your application.
You should also make sure that you are calling the Auth::routes() method in your routes/web.php file. This method will register the proper routes for the new authentication controllers.
Once these controllers have been placed into your application, you may need to re-implement any customizations you made to these controllers. For example, if you are customizing the authentication guard that is used for authentication, you may need to override the controller's guard method. You can examine each authentication controller's trait to determine which methods to override.
Upgrading laravel 5.2 to 5.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With