PHPackages                             welderlourenco/laravel-facebook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. welderlourenco/laravel-facebook

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

welderlourenco/laravel-facebook
===============================

The cleaner and more organized bridge from you to facebook platform.

v1.0.0(11y ago)69303[2 issues](https://github.com/welderlourenco/laravel-facebook/issues)MITPHPPHP &gt;=5.3.0

Since May 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/welderlourenco/laravel-facebook)[ Packagist](https://packagist.org/packages/welderlourenco/laravel-facebook)[ Docs](https://github.com/welderlourenco/laravel-facebook)[ RSS](/packages/welderlourenco-laravel-facebook/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel Facebook
================

[](#laravel-facebook)

The cleaner and more organized bridge from you to facebook platform.

Introduction
============

[](#introduction)

*Laravel Facebook* is the most simple solution for developers that need fast, autonomous and secure integration with the **Facebook platform**. Using the facebook php sdk v4 from April 28, 2014, Laravel Facebook establishes the cleaner and more organized intermediation between you and the platform.

'*It just builds a bridge. You will have to pass for it.*' -- me

Needed knowledge
================

[](#needed-knowledge)

Facebook Platform utilizes their [Graph API](https://developers.facebook.com/docs/graph-api/quickstart/v2.0) as a primary way to get data in and out of Facebook's social graph. In order to get to the bottom at this package, you'll need to have the basic knowledge in access tokens and facebook permissions, but don't worry, it's really not that hard.

Instalation
===========

[](#instalation)

Required steps
--------------

[](#required-steps)

In the ***require*** key of master ***composer.json*** file add the following.

```
"facebook/php-sdk-v4" : "4.0.*",
"welderlourenco/laravel-facebook" : "dev-master"
```

Run the Composer update comand

```
composer update

```

Once this operation completes, the final step is to add the ***provider*** and the ***alias*** in the ***app/config/app.php*** config file.

```
return array(
  // ...
  'providers' => array(
    // At the end of this array, push Laravel Facebook provider:
    'WelderLourenco\Facebook\Providers\FacebookServiceProvider'
  ),
  'aliases' => array(
    // At the end of this array, push Laravel Facebook facade:
    'Facebook'				=> 'WelderLourenco\Facebook\Facades\Facebook'
  )
)
```

Configuration
-------------

[](#configuration)

Run the Config Publish command

```
php artisan config:publish welderlourenco/laravel-facebook

```

Go to the generated config file in your application

```
return array(
    /*
	|--------------------------------------------------------------------------
	| facebook-php-sdk-v4
	|--------------------------------------------------------------------------
	|
	| Essential data provided for the facebook-php-sdk-v4. The app-id and
	| app-secret won't even be touched by welderlourenco/laravel-facebook's
	| package.
	|
	*/
	'appId'			=> '', // Id of your facebook app.
	'appSecret'		=> '', // Secret of your facebook app.
	'redirectUrl'	=> '' // Where to process the facebook answer.
);
```

Available Methods / Usage
=========================

[](#available-methods--usage)

In any page, use the connect() method without passing any arguments to get a instance of the [FacebookRedirectLoginHelper](https://developers.facebook.com/docs/php/FacebookRedirectLoginHelper/4.0.0) object, allowing you to call its native methods.

**Example: Get the login url.**

```
$FacebookRedirectLoginHelper = Facebook::connect();
echo $loginUrl = $FacebookRedirectLoginHelper->getLoginUrl();
```

Laravel Facebook allows you to chain these methods, looking way more pretty.

```
echo Facebook::connect()->getLoginUrl();
```

You can pass an array to the getLoginUrl method to define the scope.

```
echo Facebook::connect()->getLoginUrl(array('email'));
// public_profile (default scope) and email
```

---

In the redirect page, call the process() method to process the facebook answer and get a instance of the [FacebookSession](https://developers.facebook.com/docs/php/FacebookSession/4.0.0) object, allowing you to call its native methods.

**Example: Process the facebook redirect, transform it to long-lived access token and get the access token.**

```
$accessToken = Facebook::process()->getLongLivedSession()->getToken();
// Now that you have the access token, do whatever you want with it, store in database or in a cookie, it is you call.
```

---

In any page, use the connect() method again passing a accessToken as argument to get a instance of [FacebookSession](https://developers.facebook.com/docs/php/FacebookSession/4.0.0) object, allowing you to call its native methods.

**Example: Get session info.**

```
$accessToken = 'example-of-access-token';
dd(Facebook::connect($accessToken)->getSessionInfo());
```

---

In any page use the api() method passing 3 arguments to get the [GraphObject](https://developers.facebook.com/docs/php/GraphObject/4.0.0) object, allowing you to call its native methods.

**Example: Process the facebook redirect, transform it to long-lived access token and get the access token and the user personal info.**

```
// FacebookSession, you'll need this to make any api calls.
$session = Facebook::process()->getLongLivedSession();
// Access Token
$accessToken = $session->getToken();
// User info
$user = Facebook::api($session, 'GET', '/me');
```

---

In any page, before calling the connect() or process() method use the change() passing 2 required arguments and 2 optional to change the app before connecting.

**Example: Get the login url from another app.**

```
echo Facebook::change($newAppId, $newAppSecret, $optionalNewAppRedirectUrl)->connect()->getLoginUrl();
```

Thanks
======

[](#thanks)

Thank God for the knowledge to write all this.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4364d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35fab48f5a9db87ae49be2ba88616b3ffa40bf48399f2db2f4731cef1473ee6e?d=identicon)[welderlourenco](/maintainers/welderlourenco)

---

Top Contributors

[![welderlourenco](https://avatars.githubusercontent.com/u/5265316?v=4)](https://github.com/welderlourenco "welderlourenco (19 commits)")

---

Tags

laravelfacebookauth

### Embed Badge

![Health badge](/badges/welderlourenco-laravel-facebook/health.svg)

```
[![Health](https://phpackages.com/badges/welderlourenco-laravel-facebook/health.svg)](https://phpackages.com/packages/welderlourenco-laravel-facebook)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[jurager/teams

Laravel package to manage team functionality and operate with user permissions.

22817.3k](/packages/jurager-teams)[codebot/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

1596.6k](/packages/codebot-entrust)[pitchanon/facebook-connect

A Laravel package for connecting to the Meta (Facebook) Graph API.

264.3k1](/packages/pitchanon-facebook-connect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
