是的,你可以:)
创建自己的Passport客户端.
<?php
declare(strict_types=1);
namespace App\Models;
class PassportClient extends \Laravel\Passport\Client
{
/**
* Determine if the client should skip the authorization prompt.
*
* @return bool
*/
public function skipsAuthorization()
{
// todo: add some checks, e.g. $this->name === 'spa-client'
return true;
}
}
更新你的App\Providers\AuthServiceProvider
.
public function boot()
{
// ...
Passport::useClientModel(PassportClient::class);
}