PHPackages                             iluminar/fluent-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. [API Development](/categories/api)
4. /
5. iluminar/fluent-facebook

AbandonedArchivedLibrary[API Development](/categories/api)

iluminar/fluent-facebook
========================

A laravel 5 package for reading and writing to facebook graph object with ease in laravelish syntax

4976PHP

Since Aug 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Hasnayeen/fluent-facebook)[ Packagist](https://packagist.org/packages/iluminar/fluent-facebook)[ RSS](/packages/iluminar-fluent-facebook/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (3)Used By (0)

Fluent-Facebook
===============

[](#fluent-facebook)

[![License](https://camo.githubusercontent.com/e0a4aac3a57307d2e13ab280685d76de2143adcf949767f91712aa083b86e2fa/68747470733a2f2f706f7365722e707567782e6f72672f696c756d696e61722f666c75656e742d66616365626f6f6b2f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/iluminar/fluent-facebook)[![StyleCI](https://camo.githubusercontent.com/48cf3784d4aaf68069e4ef1e95cba2ccca47648e7f31e12520708d3468db10c5/68747470733a2f2f7374796c6563692e696f2f7265706f732f36353430313634352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/65401645)[![Twitter URL](https://camo.githubusercontent.com/aa9bb060a38d1dfe0f339f12827d51bcd59b4b79ac211bce3be706e1ac431fdc/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f747769747465722e636f6d2f666f6c645f6c6566742e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f772532302534306861736e617965656e)](https://twitter.com/nhasnayeen)

[Docs](https://iluminar.github.io/README.html)

A laravel 5 package for reading and writing to facebook graph object with ease in laravelish syntax. Check out how easy it is to read from facebook graph api.

```
$user = Auth::user();
$user = Fluent::user($user->fb_id)->get();
```

That's it. The $user object is a collection (`Illuminate\Support\Collection`) of facebook user data.

If you want extra information like about, first\_name, education etc. just pass an array with the field name in `with` method.

```
$user = Auth::user();
$fields = ['hometown', 'first_name', 'about', 'birthday', 'cover', 'education'];
$user = Fluent::user($user->fb_id)->with($fields)->get();
```

If you want to get the feed of the user just chain the feed method to the user object.

```
$user = Auth::user();
$feed = Fluent::user($user->fb_id)->feed()->get();
```

If you want to get information of a post just pass the post id to the `post` method.

```
$user = Auth::user();
$posts = Fluent::post($post_id)->get();
```

Install
-------

[](#install)

You can pull in the package via composer:

```
$ composer require iluminar/fluent-facebook
```

Or you can add this in your composer.json

```
"require": {
    "iluminar/fluent-facebook": "dev-develop"
}
```

and then terminal from your root directory of project run following command

```
$ composer update
```

After updating composer, add a fluent service provider to the providers array in config/app.php file.

```
 'providers' => array(
        // ...
        Iluminar\Fluent\Providers\FluentServiceProvider::class,
    )
```

then run in terminal

```
$ php artisan vendor:publish
```

to add package tables in your database run following command

```
$ php artisan migrate
```

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

[](#configuration)

First you have to [create a facebook app](https://developers.facebook.com/apps/) and set the `app_id`, `app_secret` and `redirect_uri` in the configuration file.

```
'facebook' => [
    'client_id' => env('FB_APP_ID'),
    'client_secret' => env('FB_APP_SECRET'),
    'redirect_uri' => env('FB_REDIRECT_URI'),
],
```

To define what permissions your app need you can set those permission under `scopes` key. Just change the value of particular permission scope to `true`. By default `email` permission is set to true. Remember, for extra permission you have to submit your app for review by facebook.

```
'scope' => [
    "public_profile" => false,
    "user_friends" => false,
    "email" => true,
    "user_about_me" => false,
]
```

For user authentication `fluent` use laravel's default users table and user model. But if you use different table and model then set those on config file.

```
'user_model' => 'user',
'user_table_name' => 'users',
'user_model_namespace' => 'App',
```

Usage
-----

[](#usage)

### Logging The User Into Laravel

[](#logging-the-user-into-laravel)

All the routes and authentication logic for authentication via facebook is provided by package. Just add `redirect` route to your login button, it will redirect the user to facebook login dialog box.

### Get different node information

[](#get-different-node-information)

Facebook information is represented as a social graph which composed of following three things

> `nodes` - basically "things" such as a User, a Photo, a Page, a Comment

> `edges` - the connections between those "things", such as a Page's Photos, or a Photo's Comments

> `fields` - info about those "things", such as a person's birthday, or the name of a Page

First you need to instantiate a Fluent instance.

```
$fluent = new Fluent();
```

Or if you use `fluent` facade then you dont need a `fluent` instance.

Now if you want information about a user or photo, just call a method by that name on `fluent` object, pass the id of that node i.e id of the user or photo and chained that with `get` method which will return a collection about that node.

```
$user = Fluent::user($id)->get();
```

N.B: The facebook id of the user is saved in fb\_id column of the `users` table.

When you retrieving a node information you can also specify the fields for that node to get extra information. For that just pass an array of fields name to the `with` method chained to that node call.

```
$fields = ['link', 'name', 'album'];
$photo = Fluent::photo($id)->with($fields)->get();
```

To get information of an node's edge (e.g photo's comments) just chain a method by the edge name to the node call.

```
$photo = Fluent::photo($id)->comments()->get();
```

Documentation
-------------

[](#documentation)

[Docs](https://iluminar.github.io/README.html)

### TODO

[](#todo)

> **publish option**

> **Error handling**

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability in the package, please send an e-mail to Nehal Hasnayeen at . All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

The **Fluent-facebook** is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributor
-----------

[](#contributor)

Made by [Hasnayeen](https://github.com/hasnayeen) with love in [![Bangladesh](https://camo.githubusercontent.com/9e911644f32b6be3c52930456b75ab45a763582cde56a956dd28ad64f16d630d/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f662f66392f466c61675f6f665f42616e676c61646573682e7376672f323070782d466c61675f6f665f42616e676c61646573682e7376672e706e67)](https://camo.githubusercontent.com/9e911644f32b6be3c52930456b75ab45a763582cde56a956dd28ad64f16d630d/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f662f66392f466c61675f6f665f42616e676c61646573682e7376672f323070782d466c61675f6f665f42616e676c61646573682e7376672e706e67)

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9433499?v=4)[Nehal Hasnayeen](/maintainers/Hasnayeen)[@Hasnayeen](https://github.com/Hasnayeen)

---

Top Contributors

[![Hasnayeen](https://avatars.githubusercontent.com/u/9433499?v=4)](https://github.com/Hasnayeen "Hasnayeen (10 commits)")

---

Tags

facebook-apifacebook-graphfacebook-graph-apigraph-apilaravellaravel-5-package

### Embed Badge

![Health badge](/badges/iluminar-fluent-facebook/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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