zejesago / laravel-facebook
This package is abandoned and no longer maintained.
No replacement package was suggested.
A Facebook component for Laravel.
3.1.1
2017-07-26 11:40 UTC
Requires
- php: >=5.4.0
- facebook/graph-sdk: 5.6.*
- illuminate/support: 4.0.*
This package is not auto-updated.
Last update: 2021-02-05 20:46:49 UTC
README
A Facebook component for Laravel which leverages on Laravel's Facades.
Normally:
$facebook = new Facebook(array( 'app_id' => 'YOUR_APP_ID', 'app_secret' => 'YOUR_APP_SECRET', )); // Get User ID $user = $facebook->getUser();
Now:
// Get User ID $user = Z\Facebook::getUser();
Laravel Facebook currently supports Facebook 5.6 and Laravel 4.0.
Installation
- Add the package in your
composer.json
file, then execute aphp composer.phar install
(orcomposer install
) command from your root directory. - Register the package, typically, by adding
'Zejesago\Laravel\Facebook\ServiceProvider'
in theproviders
array inapp/config/app.php
. - (Optional) Add an alias in the
aliases
array inapp/config/app.php
. E.g.'Z\Facebook' => 'Zejesago\Laravel\Facebook\Facade'
. - Run
php artisan config:publish zejesago/laravel-facebook
to create your app-specific configuration, where you can set your app ID and secret.
Testing
When doing unit testing, you may encounter some session errors thrown when instatiating Facebook.
Include the following snippet in phpunit.xml
:
<php> <server name="HTTP_HOST" value="localhost"/> <server name="REQUEST_URI" value="/"/> <server name="path" value="localhost"/> </php>
then run your tests with the --stderr
flag to prevent HTTP header generation interruptions.