<commit_before>## This repository is under construction

[![Laravel 5.1](https://img.shields.io/badge/Laravel-5.1-orange.svg?style=flat-square)](http://laravel.com) [![Latest Stable Version](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/v/stable)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![Total Downloads](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/downloads)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![Latest Unstable Version](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/v/unstable)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![License](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/license)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![Build Status](https://travis-ci.org/nikolajlovenhardt/laravel-facebook-ads.svg?branch=master)](https://travis-ci.org/nikolajlovenhardt/laravel-facebook-ads) [![Code Climate](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads/badges/gpa.svg)](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads) [![Test Coverage](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads/badges/coverage.svg)](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads/coverage)

## Facebook Ads API for Laravel

This package is an integration of [`facebook/facebook-php-ads-sdk`](https://github.com/facebook/facebook-php-ads-sdk) in Laravel 5.*.

### Setup
- Run `$ composer require nikolajlovenhardt/laravel-facebook-ads`

- Add provider
```php
'providers' => [
    LaravelFacebookAds\LaravelFacebookAdsProvider::class,
],
```

- Add facade
```php
'facades' => [
    'FacebookAds' => LaravelFacebookAds\Facades\FacebookAds::class,
],
```

### Usage

#### Dependency injection
```php
use LaravelFacebookAds\Services\FacebookAdsService;

class Controller
{
    /** @var FacebookAdsService */
    protected $facebookAdsService;

    public function __construct(FacebookAdsService $facebookAdsService)
    {
        $this->facebookAdsService = $facebookAdsService;
    }

    public function example()
    {
        $facebookInstance = $this->facebookAdsService->instance();
    }
}
```

#### Facade
```php
FacebookAds::instance()
```

- Run `$ php artisan vendor:publish` to publish the configuration file `config/facebook-ads.php`

### Dependencies
- [`facebook/facebook-php-ads-sdk`](https://github.com/facebook/facebook-php-ads-sdk)<commit_msg>README.md<commit_after>## This repository is under construction

[![Laravel 5.1](https://img.shields.io/badge/Laravel-5.1-orange.svg?style=flat-square)](http://laravel.com) [![Latest Stable Version](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/v/stable)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![Total Downloads](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/downloads)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![Latest Unstable Version](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/v/unstable)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![License](https://poser.pugx.org/nikolajlovenhardt/laravel-facebook-ads/license)](https://packagist.org/packages/nikolajlovenhardt/laravel-facebook-ads) [![Build Status](https://travis-ci.org/nikolajlovenhardt/laravel-facebook-ads.svg?branch=master)](https://travis-ci.org/nikolajlovenhardt/laravel-facebook-ads) [![Code Climate](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads/badges/gpa.svg)](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads) [![Test Coverage](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads/badges/coverage.svg)](https://codeclimate.com/github/nikolajlovenhardt/laravel-facebook-ads/coverage)

## Facebook Ads API for Laravel

This package is an integration of [`facebook/facebook-php-ads-sdk`](https://github.com/facebook/facebook-php-ads-sdk) in Laravel 5.*.

### Setup
- Run `$ composer require nikolajlovenhardt/laravel-facebook-ads`

- Add provider
```php
'providers' => [
    LaravelFacebookAds\LaravelFacebookAdsProvider::class,
],
```

- Run `$ php artisan vendor:publish` to publish the configuration file `config/facebook-ads.php`

- Add facade
```php
'facades' => [
    'FacebookAds' => LaravelFacebookAds\Facades\FacebookAds::class,
],
```

### Usage

#### Dependency injection
```php
use LaravelFacebookAds\Services\FacebookAdsService;

class Controller
{
    /** @var FacebookAdsService */
    protected $facebookAdsService;

    public function __construct(FacebookAdsService $facebookAdsService)
    {
        $this->facebookAdsService = $facebookAdsService;
    }

    public function example()
    {
        $facebookInstance = $this->facebookAdsService->instance();
    }
}
```

#### Facade
```php
FacebookAds::instance()
```

### Dependencies
- [`facebook/facebook-php-ads-sdk`](https://github.com/facebook/facebook-php-ads-sdk)
{'fraction_non_alphanumeric': 0.16335847558554983, 'fraction_numerical': 0.001984914648670107, 'mean_word_length': 5.561197916666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 34, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7671010', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1674, 'n_words': 183}