Laravel中的注册错误 [英] Registration error in Laravel
问题描述
我在Laravel 5.3中使用默认的auth/registration
.
I use the default auth/registration
in Laravel 5.3.
当我尝试注册新用户时,我收到错误消息:
When I try to register new user I get error:
FatalThrowableError in RegistersUsers.php line 33:
Call to undefined method Illuminate\Auth\TokenGuard::login()
我对Laravel配置进行了一些更改:
I have made some changes in configuration Laravel:
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
因此,默认情况下,我使用api Guard
So, by default I use api guard
推荐答案
您要使用的身份验证驱动程序api
是基于令牌的.这意味着服务器将使用凭据在成功身份验证后向您的客户端颁发令牌.然后,客户端可以在发出请求以标识自己的同时,将该令牌提供给服务器.
The authentication driver api
you are trying to use is TokenBased. That means the server will issue your client a Token on successful authentication using credentials. Then, client can present this token to server while making the request to identify itself.
如 laravel git 中所述, login()
没有任何方法.
As given in laravel git, there isn't any method as login()
.
要使用基于令牌的身份验证,这是很好的指南
To use the TokenBased Authentication, here's the good guide
这篇关于Laravel中的注册错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!