googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
291 stars 260 forks source link

Laravel Sample App - Class 'Google\Ads\GoogleAds\Lib\V9\GoogleAdsClientBuilder' not found #723

Closed will621 closed 2 years ago

will621 commented 2 years ago

macOS Monterey PHP 7.4.27 pecl grpc 1.43.0 pecl protobuf 3.19.3

When running the Laravel Sample app and getting campaign details "Class 'Google\Ads\GoogleAds\Lib\V9\GoogleAdsClientBuilder' not found" error occurs

The composer.json file with the laravel sample app is referencing
"googleads/google-ads-php": "^12.0", but the code is referencing V9 classes (which I'm thinking aren't there for 12.1.0)

To fix I just had to upgrade to v13.0.0 by running composer require googleads/google-ads-php

So I think the LaravelSampleApp composer.json (and lock) needs to be updated to "googleads/google-ads-php": "^13.0",

https://github.com/googleads/google-ads-php/blob/v13.0.0/examples/LaravelSampleApp/composer.json#L13

PierrickVoulet commented 2 years ago

Hi @will621 - Thank you for reporting this bug and suggesting a solution. I sent #724, this should avoid this type of issues in the future.