joelbutcher/laravel-facebook-graph

Laravel wrapper for the Facebook Graph SDK for PHP 7.4 and PHP 8.
178,524 74
Install
composer require joelbutcher/laravel-facebook-graph
Latest Version:v1.5.0
PHP:^7.3|^8.0
License:MIT
Last Updated:May 23, 2026
Links: GitHub  ·  Packagist
Maintainer: joelbutcher

Laravel Facebook Graph SDK

Installation

Getting started with Laravel Facebook Graph is easy - first, install the package via composer

composer require joelbutcher/laravel-facebook-graph

Then publish the package config:

php artisan vendor:publish --provider="JoelButcher\Facebook\FacebookServiceProvider"

This will add a config/facebook.php file to your project. Here you may configure the following options:

Option Description
app_id Used to identify your app when requesting a users' access token
app_secret The secret key used to authorize your app with Facebook
redirect_url The destination URL to redirect users to, after authenticating with Facebook
graph_version The graph version to target when making user-authenticated requests to the Facebook Graph API, defaults to v11.0
beta_mode Indicates whether or not to run a beta version of the SDK

URL Detection Handler

You may add a custom URL Detection handler, by binding a singleton your implementation in the register method of the AppServiceProvider:

$this->app->singleton(UrlDetectionInterface::class, fn ($app) => $app[UrlDetectionHandler::class])

Persistent Data Handlers

In order to store the state for OAuth requests to Facebook, you will either need to register a persistent data handler. You can find an example of how to do this here

HTTP Client

The current version of the Facebook Graph SDK (v6) uses HTTPlug for making requests. If you wish to use your own HTTP Client, it MUST implment the Http\Client\HttpClient interface. Please refer to this example

Related Packages

gponster/laravel-facebook-sdk

Facebook SDK wrapper for Laravel 4

12 0
carloscsrm/sharelaravel

Share content in Facebook and Twitter

10 0
edbizarro/laravel-facebook-ads

Facebook & Instagram Ads for Laravel 5.6

30,250 135
marcin-orlowski/laravel-api-response-builder

Helps building nice, normalized and easy to consume Laravel REST API.

533,783 853

Version History

Version Released PHP Laravel License
v1.5.0 ^7.3|^8.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v1.4.0 ^7.3|^8.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.3.1 ^7.3|^8.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.3.0 ^7.3|^8.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.2.3 ^7.3|^8.0 ^6.0|^7.0|^8.0|^9.0|^10.0 MIT
Pre-releases (1)
Version Released PHP Laravel License
1.0.0-beta1 ^7.4|^8.0 ^6.0|^7.0|^8.0 MIT