abhimanyusharma003 / laravel-facebook
There is no license information available for the latest version (dev-master) of this package.
A laravel service provider for Facebook PHP SDK
Package info
github.com/abhimanyusharma003/laravel-facebook
pkg:composer/abhimanyusharma003/laravel-facebook
dev-master
2014-06-02 06:47 UTC
Requires
- php: >=5.3.0
- illuminate/support: 4.*
This package is not auto-updated.
Last update: 2026-03-14 23:42:43 UTC
README
Facebook PHP SDK for Laravel
Installation
-
Add below line to
composer.json"abhimanyusharma003/laravel-facebook": "dev-master" -
Run
composer updateorcomposer install -
Open
app/config/app.phpand add the service provider to yourprovidersarray.'providers' => array( 'Abhimanyusharma003\LaravelFacebook\LaravelFacebookServiceProvider', )
-
Now add the alias.
'aliases' => array( 'Facebook' => 'Abhimanyusharma003\LaravelFacebook\LaravelFacebookFacade', )
Configuration
- Run
php artisan config:publish abhimanyusharma003/laravel-facebook - This will create a
config.phpfile inconfig\packages\abhimanyusharma003\laravel-facebookfolder - Customize
config.phpwith your information
Setting details are.
appid: Your facebook app id.secret: Your facebook app secret.redirect: URL where to redirect after log in.logout: URL where to redirect after logout.scope: These are permission you want from your users
Examples
-
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(); });