nikolajlovenhardt/laravel-facebook-ads

This package is abandoned and no longer maintained. The author suggests using the spotonlive/laravel-facebook-ads package instead.

Facebook integration for Laravel

1.5 2021-10-05 08:18 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:57:54 UTC


README

Laravel 5.3 Latest Stable Version Total Downloads Latest Unstable Version License Build Status Code Climate Test Coverage

Facebook Ads API for Laravel 5.*

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

Composer

  • Run $ composer require spotonlive/laravel-facebook-ads

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(),
        ]);
    }
}

Credits