After running this composer require google/apiclient:^2.0
in order to use the PHP Google Sheets API. Some of you may encounter this problem, such as getting error when typing Google_Client or using Google_Service_Sheets.
To fix Google_Client error you only need to restart your Visual Studio Code.
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-35-1024x391.png)
However, the error in the Google_Service_Sheets are still there and to solve that, you just need to change that into Sheets.
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/blog-2-1024x347.jpg)
After that it will automatically generate use Google\Service\Sheets;
on top of the PHP file. Then the error will gone.
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-36-1024x430.png)