ehkeuw
Last Updated: February 25, 2016
·
575
· heldrida

Laravel 4: Include new package

Visit packagist.org, find a package that you'd like to include into your project. Let's say Facebook SDK. You'll see that there's a reference mentioning > require : "facebook/php-sdk": "dev-master"

1) Open your composer.json located in the root of your laravel project and include the package, as follows:

"require": {
    "laravel/framework": "4.0.*",
    "facebook/php-sdk": "dev-master"
}

2) The run composer update, to install it

composer update 

3) Should be ready to go, just run:

$fb = new Facebook(array('appId'  => 'zzzz', 'secret' => 'zzzz'));

var_dump($fb);

That's all!