Я использую OAuth 2.0 flow + google-api-php-client + Mybusiness PHP классы, но я получил ошибки "класс не найден", см. Ниже:
use App\Vendors\Google_Service_MyBusiness as MyBusiness;
....
$gClient->setAccessToken($access_token);
$oauth2 = new \Google_Service_Oauth2($gClient);
$userInfo = $oauth2->userinfo->get();
print_r($userInfo); //Works!
$mybusinessService = new MyBusiness($gClient);
//return Class 'Google_Service_MyBusiness_Location' not found:
$mybusinessService->accounts->get('accounts/xxxxxxxx');
//return 'Google_Service_MyBusiness_ListAccountsResponse' not found:
$accounts = $mybusinessService->accounts;
$accountsList = $accounts->listAccounts()->getAccounts();
Полная ошибка:
Class 'Google_Service_MyBusiness_Account' not found in file /vendor/google/apiclient/src/Google/Http/REST.php on line 128
Класс MyBusiness добавлен в автозагрузку:
"autoload" : {
"files": [
"app/Vendors/MyBusiness.php"
]
}
Все необходимые классы (например, Google_Service_MyBusiness_ListAccountsResponse
, Google_Service_MyBusiness_Location
в app/Vendors/MyBusiness.php
)
Что не так с моимкод