pulkitjalan / google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support
MIT License
246 stars 75 forks source link

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

Closed Xsert closed 6 days ago

Xsert commented 1 year ago

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);
    }
pulkitjalan commented 6 days ago

Looks resolved now.

Screenshot 2024-06-30 at 21 50 42