Download the PHP package pitchanon/facebook-connect without Composer
On this page you can find all versions of the php package pitchanon/facebook-connect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package facebook-connect
Facebook Connect for Laravel
A small Laravel package that wraps the Meta (Facebook) Graph API for the common OAuth login flow, profile lookup, page posting, and "does this user like a page" checks. Works with Laravel 11 / 12 and PHP 8.2+.
The package talks to Graph API v19.0 by default over plain HTTP (Guzzle), so
it does not depend on the archived facebook/graph-sdk package.
Version compatibility
| Package version | Laravel | PHP | Facebook SDK | Status |
|---|---|---|---|---|
^2.0 |
11.x, 12.x | ^8.2 | Graph API v19 (Guzzle client) | Current |
^1.0 |
4.x, 5.x | >= 5.3 | Bundled Facebook PHP SDK 3.x | Maintenance |
The legacy 1.x line is kept on the 1.x branch for existing Laravel 4/5 users.
Critical fixes may still be backported, but new features only land on 2.x.
Installation
Latest (Laravel 11/12):
Legacy (Laravel 4/5):
The service provider and FacebookConnect facade are auto-discovered.
Publish the config file:
Then set your Meta app credentials in .env:
Usage
1. Redirect the user to Facebook
2. Handle the callback
3. Post to a user or page feed
For page posts, pass the page ID as target and use a page access token
(available via FacebookConnect::getUserAccounts($userAccessToken)).
4. Check if a user likes a page
5. Verify granted permissions
6. Arbitrary Graph calls
Errors
All Graph API errors are thrown as
Pitchanon\FacebookConnect\Exceptions\FacebookConnectException with the message
and code returned by Meta.
Migration notes (from the old Laravel 4 version)
- The bundled Facebook PHP SDK v3.2.2 has been removed — it has been
unmaintained since 2018 and relied on deprecated endpoints (
fql.query,setExtendedAccessToken, cookie-based sessions). FacebookConnect::getUser($permissions, $url_app)no longer exists as a one-shot "redirect or return profile" method. UsegetLoginUrl()+getAccessTokenFromCode()+getUser($accessToken)instead — this is testable and does notecho/exitfrom inside the class.offline_accessandpublish_streamhave been removed by Meta years ago. Use long-lived tokens (getLongLivedToken()) and the current publishing permissions (e.g.pages_manage_postsfor page posting, subject to app review).- The check-fan call no longer uses FQL (deprecated since 2016); it uses the
/{user-id}/likes/{page-id}edge instead.
License
GPL-3.0-or-later. See LICENSE.