- 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
Copyright kawax