Skip to content

palpalani/laravel-facebook-ads

 
 

Repository files navigation

Laravel 5.3 Latest Stable Version Total Downloads Latest Unstable Version License Build Status Code Climate Test Coverage GitHub Tests Action Status GitHub Code Style Action Status

Facebook Ads API for Laravel

This package is an integration of facebook/facebook-php-ads-sdk in Laravel.

Installation

You can install the package via composer:

composer require spotonlive/laravel-facebook-ads`

You can publish the config file with:

php artisan vendor:publish --provider="palPalani\LaravelFacebookAds\LaravelFacebookAdsServiceProvider" --tag="laravel-facebook-ads-config"

Examples

Client

<?php

namespace App\Http\Controllers;

use LaravelFacebook\Clients\Facebook;

class AdsController
{
    /** @var Facebook */
    protected $facebookClient;

    public function __construct(Facebook $facebookClient)
    {
        $this->facebookClient = $facebookClient;
    }

    /**
     * Show ads
     *
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function ads()
    {
        $client = $this->facebookClient;

        $accountId = 'act_12345678';

        return view('ads', [
            'ads' => $client->account($accountId)->ads(),
        ]);
    }
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Facebook integration for Laravel

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 97.6%
  • Blade 2.4%