如何更改 laravel 5.2 上的默认登录页面,我已经更改了:
Added "protected $username = 'my_new_field';" to AuthController.php
Added "protected $table = 'user';" to Users.php
我想在这里做的是,我想使用 user_id 作为用户名,而不是使用电子邮件登录,但即使在所有这些更改之后,我仍然会得到:
"这些凭据与我们的记录不匹配",是什么原因造成的?
同样,我使用的是"用户",而不是使用"用户"表
如果您
正在考虑更改laravel默认登录,但仅使用用户名而不是电子邮件,那么我建议您在AuthenticatesUsers上进行更改.php您可以在其中找到public function postLogin(Request $request)
并且可以更改请求需求,如果需要许多字段,我建议您 https://laravel.com/docs/5.2/authentication#adding-custom-guards
您可以通过
覆盖getCredentials()
方法来实现它,在AuthController
中。