| Package Data | |
|---|---|
| Maintainer Username: | EliuFlorez |
| Maintainer Contact: | eflorez@socialh4ck.com (socialh4ck) |
| Package Create Date: | 2014-07-10 |
| Package Last Update: | 2014-10-29 |
| Home Page: | |
| Language: | PHP |
| License: | Unknown |
| Last Refreshed: | 2025-10-27 03:22:39 |
| Package Statistics | |
|---|---|
| Total Downloads: | 208 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 0 |
| Total Watchers: | 0 |
| Total Forks: | 1 |
| Total Open Issues: | 0 |
Facebook PHP SDK for Laravel
Add socialh4ck/facebook to composer.json.
"socialh4ck/facebook": "dev-master"
Run composer update to pull down the latest version of Facebook.
Now open up app/config/app.php and add the service provider to your providers array.
'providers' => array(
'Socialh4ck\Facebook\FacebookServiceProvider',
)
Now add the alias.
'aliases' => array(
'Facebook' => 'Socialh4ck\Facebook\FacebookFacade',
)
Run php artisan config:publish socialh4ck/facebook and modify the config file with your own informations.
Get Login Url with your credentials and scope.
Route::get('/', function() { return Facebook::loginUrl(); });
Get User Id
Route::get('/', function() { return Facebook::getUser(); });
Use facebook API
Route::get('/', function() { $profile = Facebook::api('/me?fields=id,name'); });
Get Logout Url
Route::get('/', function() { return Facebook::logoutUrl(); });
FQL
Route::get('/', function() { return Facebook::api(array( 'method' => 'fql.query', 'query' => "SELECT uid, sex, username, birthday, education, work FROM user WHERE uid = me()", )); });