Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Facebook

Laravel Facebook Laravel Package

irazasyed/laravel-facebook

Laravel Facebook integrates the Facebook PHP SDK with Laravel, offering a simple facade, configuration, and helpers for Facebook Graph API requests, login/authentication, and fetching user data in Laravel applications.

View on GitHub
Deep Wiki
Context7

Laravel 4 support for Facebook SDK

Frequently asked questions about Laravel Facebook
How do I install irazasyed/laravel-facebook in a Laravel application?
Install it with Composer by running composer require irazasyed/laravel-facebook. On Laravel versions that support package auto-discovery, the service provider and Facebook facade are registered automatically; on older versions you add them to the providers and aliases arrays in config/app.php. After that, set your Facebook app credentials in the package configuration before making any Graph API calls.
Which Laravel and PHP versions does laravel-facebook support?
The package is built on Laravel's service provider and facade system and wraps the Facebook PHP SDK, so support depends on the release you install. Check the require section of the package's composer.json on GitHub or Packagist for the exact illuminate/support and PHP constraints. Because it relies on auto-discovery on modern Laravel, most recent releases work without manual provider registration, but confirm the constraint before upgrading a major Laravel version.
How do I configure Facebook app credentials for this package?
Credentials live in the package configuration file, where you typically set your Facebook app ID, app secret, and related SDK options such as the default Graph API version and redirect URI. Keep those values in your .env file and reference them from the config so secrets are never committed to source control. Remember that configuration is cached with Laravel's config cache, so clear it after changing credentials.
How do I make Graph API requests using the Facebook facade?
The Facebook facade proxies calls to the underlying Facebook PHP SDK, so any Graph API endpoint the SDK supports is reachable through it. You provide an access token to the client and then request endpoints such as me or a specific page ID, receiving the SDK's response object that you can decode into an array. Because it is a thin wrapper, the official SDK documentation for request syntax and error handling applies.
How do I implement Facebook Login and handle access tokens with this package?
You generate the Facebook login URL with the SDK's login helper, redirect the user, and handle the callback route where Facebook returns a code. Exchange that code for an access token, then use the token with the facade for subsequent Graph API requests. Your application remains responsible for storing and refreshing tokens; the package handles the SDK wiring rather than your app's full authentication flow.
How do I fetch a user's profile or page data from the Facebook Graph API?
After the user grants the required permissions during login, call the Graph API through the facade using their access token, for example requesting the me endpoint with a fields parameter. The response is an SDK response object you can convert to an array for your views or database. If a call fails, the SDK throws an exception, so wrap requests in try/catch and handle expired or revoked tokens.
How can I test code that uses the Facebook facade without hitting the real API?
Swap the Facebook facade for a mock using Laravel's Facade::shouldReceive or Facade::swap so calls return canned responses instead of reaching Facebook. Alternatively, inject the underlying client through the container and bind a fake implementation in your test case. This keeps your suite fast and independent of network access or valid access tokens.
Is irazasyed/laravel-facebook still maintained and safe for production use?
Check the repository's recent commits, open issues, and latest tagged release to judge current maintenance activity before adopting it. The package is a thin wrapper around the official Facebook PHP SDK, so most breaking changes come from the SDK itself or from new Laravel major versions. For production, pin the version in composer.json, keep your app secret out of source control, and test token handling and Graph API error paths.
What are the alternatives to this package for Facebook integration in Laravel?
Alternatives include using the official Facebook PHP SDK directly, Laravel Socialite for login-only flows, or other community wrappers that offer similar facade integration. This package makes sense when you want full Graph API access plus Laravel-style configuration and facades; if you only need Facebook Login, Socialite is a lighter option. Compare maintenance activity and Laravel version constraints before choosing.
Can I use laravel-facebook with Lumen or without Laravel?
It is designed for Laravel: it registers a service provider and facade and reads credentials from Laravel configuration. Lumen can use it if you enable facades and register the service provider and configuration manually in bootstrap/app.php. Outside of Laravel you are better off using the Facebook PHP SDK directly, since the wrapper adds little without the framework.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console