I'm trying to use google-api-php-client in my laravel project.
I'm installed the package using "composer require google/apiclient" command and also added the following line in composer.json.
{
"autoload": {
"classmap": [
"vendor/google/apiclient/src/Google"
],
}
}
and run this command too "composer dump-autoload"
But whenever i try to create new Google Client object, it keeps returning fatal error : Google_Client not found.
Can anybody help me with this issue?.Thanks.
I have already tried following ways.
(1) use Google_Client;
(2) $client = new Google_Client;
(3) $client = new \Google_Client;
Google_Client, Google_Service_YouTube etc are aliases to Google\Client and Google\Service\Youtube respectively. To import them, use:
use Google\Client as Google_Client;
use Google\Service\YouTube as Google_Service_YouTube;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With