当我使用护照包时,这样做后,
$success['token'] = $users->createToken('MyApp')->accessToken;
我将处理此代码中的错误:
protected function createRequest($client, $userId, array $scopes)
{
return (new ServerRequest)->withParsedBody([
'grant_type' => 'personal_access',
'client_id' => $client->id,
'client_secret' => $client->secret,
'user_id' => $userId,
'scope' => implode(' ', $scopes),
]);
}
错误文本:
Trying to get property 'id' of non-object
为什么 clinet variabale 为 null ?
最佳答案
我升级到 ^3.0 时遇到了同样的问题。我运行 php artisanpassport:install --force 来重新生成 key 并且它起作用了。
关于laravel - 尝试在 createToken() 之后获取护照上非对象的属性 'id',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49905826/