革命 / authorize-google-api
授权HTTP客户端管理器:谷歌API驱动器
1.1.0
2020-03-04 11:57 UTC
Requires
- php: ^7.2||^8.0
- google/apiclient: ^2.2
- illuminate/support: *
- revolution/authorize-manager: dev-master
This package is auto-updated.
Last update: 2024-09-04 21:55:34 UTC
README
要求
- PHP >= 7.2
- Laravel >= 5.8
安装
composer require revolution/authorize-google-api
使用
$credentials = [ 'application_name' => '', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => '', 'scopes' => [\Google_Service_PhotosLibrary::PHOTOSLIBRARY], 'access_type' => 'online', 'approval_prompt' => 'auto', 'prompt' => 'consent', ]; if (Authorize::driver('google-api')->login($credentials)) { /** * @var \Google_Client $client */ $client = Authorize::driver('google-api')->client(); $client->setAccessToken($token); $photos = new \Google_Service_PhotosLibrary($client); }
许可协议
MIT
版权所有 kawax