google-apiclient
google-apiclient copied to clipboard
Google Sheets API now uses underscores instead of backslash which causes the package to throw UnknownServiceException error
Google Sheets API now uses underscores instead of backslash which causes the package to throw UnknownServiceException error
https://developers.google.com/sheets/api/guides/values#write_multiple_ranges
vendor\pulkitjalan\google-apiclient\src\Client.php
/**
* Getter for the google service.
*
* @param string $service
* @return \Google_Service
*
* @throws \Exception
*/
public function make($service)
{
$service = 'Google\\Service\\'.ucfirst($service);
if (class_exists($service)) {
$class = new \ReflectionClass($service);
return $class->newInstance($this->client);
}
throw new UnknownServiceException($service);
}