Laravel 使用代码创建护照客户端
Laravel passport client creation using code
有没有人知道使用代码创建护照客户端,因为我可以使用命令创建它,但我如何使用代码实现它???
非常感谢您的帮助。
提前致谢
我自己做的,下面是通过代码手动生成 oAuth 客户端的代码片段。
$oauth_client = new oAuthClient();
$oauth_client->user_id = $last_inserted_id;
$oauth_client->name = $user->name;
$oauth_client->secret =base64_encode(hash_hmac('sha256',Hash::make($_REQUEST['password']), 'secret', true));
$oauth_client->password_client=1;
$oauth_client->personal_access_client = 0;
$oauth_client->redirect = 'redirect_uri';
$oauth_client->revoked= 0;
$oauth_client->save(); // Saving oauth client
有没有人知道使用代码创建护照客户端,因为我可以使用命令创建它,但我如何使用代码实现它???
非常感谢您的帮助。
提前致谢
我自己做的,下面是通过代码手动生成 oAuth 客户端的代码片段。
$oauth_client = new oAuthClient();
$oauth_client->user_id = $last_inserted_id;
$oauth_client->name = $user->name;
$oauth_client->secret =base64_encode(hash_hmac('sha256',Hash::make($_REQUEST['password']), 'secret', true));
$oauth_client->password_client=1;
$oauth_client->personal_access_client = 0;
$oauth_client->redirect = 'redirect_uri';
$oauth_client->revoked= 0;
$oauth_client->save(); // Saving oauth client