答案 0 :(得分:0)
正如 documentation 建议的那样,您可以调用自己的 oauth 服务器来获取令牌。
use Illuminate\Support\Facades\Http;
private function getClientToken() {
$response = Http::asForm()->post(route('passport.token'),[
'grant_type' => 'client_credentials',
'client_id' => 'client-id',
'client_secret' => 'client-secret',
'scope' => 'your-scope',
]);
return $response->json()['access_token'];
}