Laravel jwt-auth 怎么直接生成 token,而不是使用自带的 user 模型
$jwt = container()->get(Jwt::class);
$account->setAttribute('token', (string)$jwt->getToken([
'iat' => time(),
'exp' => time() + 86400 * 30,
'nbf' => time(),
'jti' => uniqid(),
'uid' => $account->id,
'phone' => $account->phone,
'code' => $body['verification_code'],
]));
推荐文章: