PHP code example of kly-infeed / gam
1. Go to this page and download the library: Download kly-infeed/gam library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kly-infeed / gam example snippets
php artisan vendor:publish
namespace App\Http\Controllers;
use GAM;
class TestController
{
/**
* Redirect the user to the Infeed Google AdManager authentication page.
*
* @return \Illuminate\Http\Response
*/
function auth()
{
return GAM::requestAccessToken([
'get-advertisers' //scope
]);
}
function callback()
{
$callback = GAM::callback();
dd($callback);
}
}
GAM::get('network', null, function($result){
dd($result);
});