Edujugon / laravel-google-ads

Google Adwords API for Laravel
MIT License
68 stars 23 forks source link

The service 'CampaignService' is not found #51

Open amitklahiri opened 4 years ago

amitklahiri commented 4 years ago

Hi.

I am using this library with Laravel 6.

  1. I have configured google-ads.php with the correct configuration. Also, update the 'refreshToken' with the new token received in the console panel.

  2. use Edujugon\GoogleAds\GoogleAds;

  3. Trying to list all the available campaign id and name. Getting this code snippets here and try it like this,

$response = $ads->service(CampaignService::class) ->select(['Id', 'Name', 'Status', 'ServingStatus', 'StartDate', 'EndDate']) ->get();

  1. Receive the below error. Edujugon\GoogleAds\Exceptions\Service The service 'App\Http\Controllers\CampaignService' is not available. Please pass a valid service

Please help me to resolve the issues. Let me know if you need further information. I am waiting for your reply.

Thanks.

nlrchudamani commented 4 years ago

use Google\AdsApi\AdWords\v201809\cm\CampaignService; add this to your controller