2017 © Pedro Peláez
 

library laravel-facebook

image

thomaswelton/laravel-facebook

  • Thursday, November 14, 2013
  • by thomaswelton
  • Repository
  • 6 Watchers
  • 42 Stars
  • 26,609 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 18 Forks
  • 3 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status Latest Stable Version Total Downloads Bitdeli Badge, (*1)

Installation

Update your composer.json file to include this package as a dependency, (*2)

"thomaswelton/laravel-facebook": "dev-master"

Register the Facebook service provider by adding it to the providers array in the app/config/app.php file., (*3)

Thomaswelton\LaravelFacebook\LaravelFacebookServiceProvider

Alias the Facebook facade by adding it to the aliases array in the app/config/app.php file., (*4)

'aliases' => array(
    'Facebook' => 'Thomaswelton\LaravelFacebook\Facades\Facebook'
)

Configuration

Copy the config file into your project by running, (*5)

php artisan config:publish thomaswelton/laravel-facebook

Edit the config file to include your app ID and secret key., (*6)

Useage

This Facebook class extends the Facebook PHP SDK, so all the methods listed here http://developers.facebook.com/docs/reference/php/ are available, as well as the folowing., (*7)

getShareUrl

Get a share URL. If you have not set your app ID then the URL will use the old sharer.php urls as they do not require an app ID or redirect_url, (*8)


$shareData = array( 'link' => '', // url 'picture' => '', // picture url 'name' => '', // Title 'caption' => '', // Caption 'description' => '', // Description ); echo Facebook::getShareUrl($shareData);

hasLiked

For page tab apps, will let you know if a user has liked the page. Returns - 1 - Liked - 0 - Not liked - -1 - Don't know either way, (*9)

Facebook::hasLiked();

The Versions