2017 © Pedro Peláez
 

library laravel-facebook-ads

Facebook & Instagram Ads for Laravel 5.6

image

edbizarro/laravel-facebook-ads

Facebook & Instagram Ads for Laravel 5.6

  • Friday, July 27, 2018
  • by edbizarro
  • Repository
  • 8 Watchers
  • 24 Stars
  • 4,471 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 10 Open issues
  • 21 Versions
  • 326 % Grown

The README.md

![logo](laravel-facebook-ads.png) , (*1)

Laravel Facebook Ads

Get ads infos (campaigns, ads, insights, etc...) from Facebook & Instagram Ads API, (*2)

  • Supported Facebook API version: >= v3.0

[![Packagist](https://img.shields.io/packagist/v/edbizarro/laravel-facebook-ads.svg)](https://packagist.org/packages/edbizarro/laravel-facebook-ads) [![Code Climate](https://codeclimate.com/github/edbizarro/laravel-facebook-ads/badges/gpa.svg)](https://codeclimate.com/github/edbizarro/laravel-facebook-ads) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/1417f30a21a549be812b54d59fdfdf0e)](https://www.codacy.com/app/edbizarro/laravel-facebook-ads?utm_source=github.com&utm_medium=referral&utm_content=edbizarro/laravel-facebook-ads&utm_campaign=Badge_Grade) [![StyleCI](https://styleci.io/repos/55666212/shield)](https://styleci.io/repos/55666212) ![Packagist](https://img.shields.io/packagist/dm/edbizarro/laravel-facebook-ads.svg) , (*3)


Installation

Follow this steps to use this package on your Laravel installation, (*4)

Installing with composer

composer require edbizarro/laravel-facebook-ads

The package will automatically register it's service provider., (*5)

For Laravel <= 5.4 add the provider manually, (*6)

Load service provider (optional Laravel <= 5.4 only)

You need to update your config/app.php configuration file to register our service provider, adding this line on providers array:, (*7)

Edbizarro\LaravelFacebookAds\Providers\LaravelFacebookServiceProvider::class

Enable the facade (optional)

This package comes with an facade to make the usage easier. To enable it, add this line at config/app.php on alias array:, (*8)

'FacebookAds' => Edbizarro\LaravelFacebookAds\Facades\FacebookAds::class

Configuration

If you want to change any configurations, you need to publish the package configuration file. To do this, run artisan vendor:publish --provider="Edbizarro\LaravelFacebookAds\Providers\LaravelFacebookServiceProvider" on terminal. This will publish a facebook-ads.php file on your configuration folder like this:, (*9)

<?php
return [
    'app_id' => env('FB_ADS_APP_ID'),
    'app_secret' => env('FB_ADS_APP_SECRET'),
];

Note that this file uses environment variables, it's a good practice put your secret keys on your .env file adding this lines on it:, (*10)

FB_ADS_APP_ID="YOUR_APP_ID"
FB_ADS_APP_SECRET="YOUR_APP_SECRET_KEY"

First steps

Before using it, it's necessary to initialize the library with an valid access token, php example with:, (*11)

FacebookAds::init($accessToken);

Now that everything is set up, it's easy to start using!, (*12)

Example getting all ads

$ads = FacebookAds::adAccounts()->all()->map(function ($adAccount) {
  return $adAccount->ads(
      [
          'name',
          'account_id',
          'account_status',
          'balance',
          'campaign',
          'campaign_id',
          'status'
      ]
  );
});

Usage

To obtain a list of all AdAccount available fields, look at this., (*13)

adAccounts

To obtain an adAccounts instance:, (*14)

$adAccounts = $adsApi->adAccounts();

all

Use this method to retrieve your owned Ad Accounts. This method accepts an array as argument containing a list of fields., (*15)

To obtain a list of all available fields, look at this., (*16)

$adAccounts->all(['account_id', 'balance', 'name']);

get

Use this method to get details of an AdAccount. This method accepts an array as argument containing a list of fields and an account_id act_<AD_ACCOUNT_ID>, (*17)

To obtain a list of all available fields, look at this., (*18)

$adAccounts->get(['account_id', 'balance', 'name'], 'act_<AD_ACCOUNT_ID>');

Campaigns

To obtain an Campaigns instance:, (*19)

$campaigns = $adsApi->campaigns();

all

Use this method to retrieve your adAccount campaigns. This method accepts an array as argument containing a list of fields and an account_id act_<AD_ACCOUNT_ID>, (*20)

To obtain a list of all available fields, look at this., (*21)

$campaigns->all(['name'], 'act_<AD_ACCOUNT_ID>');

License

FOSSA Status, (*22)

The Versions

27/07 2018

dev-master

9999999-dev

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

27/07 2018

v0.9.3

0.9.3.0

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

07/05 2018

v0.9.2

0.9.2.0

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

06/05 2018

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

06/05 2018

v0.9.1

0.9.1.0

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

23/03 2018

dev-analysis-Xl1lNw

dev-analysis-Xl1lNw

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

23/03 2018

0.9.0

0.9.0.0

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

23/03 2018

1.0.x-dev

1.0.9999999.9999999-dev

Facebook & Instagram Ads for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook instagram ads insights

21/02 2017

dev-develop

dev-develop

Facebook Ads for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook ads insights

21/02 2017

v0.8.2

0.8.2.0

Facebook Ads for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook ads insights

20/02 2017

v0.8.1

0.8.1.0

Facebook Ads for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook ads insights

20/02 2017

v0.8

0.8.0.0

Facebook Ads for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook ads insights

29/12 2016
12/04 2016

v0.4.1

0.4.1.0

Facebook Ads for Laravel 5.*

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php sdk facebook ads