tmarois / laravel-ads-sdk

PHP SDK for Google Ads, Bing Ads, and Facebook Ads API for Laravel
MIT License
113 stars 46 forks source link

How to support lumen? #37

Closed wenson closed 3 years ago

wenson commented 3 years ago

hi man, run composer require tmarois/laravel-ads-sdk is ok.

but php artisan vendor:publish is not work.

What's the next step?

thx a lot.

wenson commented 3 years ago

//LaravelAds register $app->register(\LaravelAds\Providers\LaravelAdsProvider::class);

// LaravelAds alias $app->alias('LaravelAds',\LaravelAds\Facades\LaravelAds::class);

add this code to bootstrap/app.php, but Still no work

timothymarois commented 3 years ago

Hi,

I've not tested on the right install flow for Lumen yet, however, it runs like a regular composer package. The install for laravel is mainly for the config, and the use of Collections. You might be able to bypass that by running the manual config, like this example, and it might work as expected in your project.

https://github.com/tmarois/laravel-ads-sdk/blob/master/GoogleAds-SDK.md#manual-configuration

wenson commented 3 years ago

it's ok.

composer require tmarois/laravel-ads-sdk

 bootstrap/app.php

// register facebook-ads config file
$app->configure('facebook-ads');

//LaravelAds register
$app->register(\LaravelAds\Providers\LaravelAdsProvider::class);

// LaravelAds alias
$app->alias('LaravelAds',\LaravelAds\Facades\LaravelAds::class);

App\Http\Controllers\FacebookControllers.php

use LaravelAds\LaravelAds;
$facebookAds = LaravelAds::facebookAds()->with('1111111');

it's work now . but have another question .