Package Data | |
---|---|
Maintainer Username: | culshaw |
Maintainer Contact: | boparaiamrit@gmail.com (boparaiamrit) |
Package Create Date: | 2013-12-20 |
Package Last Update: | 2013-12-20 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-22 03:13:58 |
Package Statistics | |
---|---|
Total Downloads: | 74 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 4 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Facebook PHP SDK for Laravel
Add boparaiamrit/facebook
to composer.json
.
"boparaiamrit/facebook": "dev-master"
Run composer update
to pull down the latest version of Twitter.
Now open up app/config/app.php
and add the service provider to your providers
array.
'providers' => array(
'Boparaiamrit\Facebook\FacebookServiceProvider',
)
Now add the alias.
'aliases' => array(
'Facebook' => 'Boparaiamrit\Facebook\FacebookFacade',
)
Run php artisan config:publish boparaiamrit/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,first_name,last_name,username,email,gender,birthday,hometown,location,picture.width(100)'); });
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()", )); });