2017 © Pedro Peláez
 

library facebook

Facebook PHP SDK Package for Laravel 4.1

image

culshaw/facebook

Facebook PHP SDK Package for Laravel 4.1

  • Friday, December 20, 2013
  • by culshaw
  • Repository
  • 2 Watchers
  • 2 Stars
  • 68 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 28 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

I take no credit for this at all, this is all boparaiamrit's work, this is just to preserve my sanity while they update they're package.

Facebook

Facebook PHP SDK for Laravel, (*1)

Add boparaiamrit/facebook to composer.json., (*2)

"boparaiamrit/facebook": "dev-master"

Run composer update to pull down the latest version of Twitter., (*3)

Now open up app/config/app.php and add the service provider to your providers array., (*4)

'providers' => array(
    'Boparaiamrit\Facebook\FacebookServiceProvider',
)

Now add the alias., (*5)

'aliases' => array(
    'Facebook' => 'Boparaiamrit\Facebook\FacebookFacade',
)

Configuration

Run php artisan config:publish boparaiamrit/facebook and modify the config file with your own informations., (*6)

  1. AppId => If you donot have appId then get it from facebook developer apps.
  2. Secret => Its come with appId.
  3. Redirect => Specify redirect url after logged in with facebook.
  4. Logout => When somebody logout from your site, it redirects to logout url.
  5. Scope => These are permission you want from your users.

Examples

  1. Get Login Url with your credentials and scope., (*7)

    Route::get('/', function() { return Facebook::loginUrl(); });, (*8)

  2. Get User Id, (*9)

    Route::get('/', function() { return Facebook::getUser(); });, (*10)

  3. Use facebook API, (*11)

    Route::get('/', function() { $profile = Facebook::api('/me?fields=id,name,first_name,last_name,username,email,gender,birthday,hometown,location,picture.width(100)'); });, (*12)

  4. Get Logout Url, (*13)

    Route::get('/', function() { return Facebook::logoutUrl(); });, (*14)

  5. FQL, (*15)

    Route::get('/', function() { return Facebook::api(array( 'method' => 'fql.query', 'query' => "SELECT uid, sex, username, birthday, education, work FROM user WHERE uid = me()", )); });, (*16)

The Versions

20/12 2013

dev-master

9999999-dev

Facebook PHP SDK Package for Laravel 4.1

  Sources   Download

The Requires

 

by Avatar boparaiamrit

laravel facebook laravel4