google-apiclient icon indicating copy to clipboard operation
google-apiclient copied to clipboard

Google Sheets API now uses underscores instead of backslash which causes the package to throw UnknownServiceException error

Open Xsert opened this issue 2 years ago • 0 comments

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 image

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);
    }

Xsert avatar Jun 15 '23 14:06 Xsert