Laravel 4 Include New Package

Visit, 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"
  1. The run composer update, to install it
composer update 
  1. Should be ready to go, just run:
$fb = new Facebook(array('appId'  => 'zzzz', 'secret' => 'zzzz'));


That’s all!

comments powered by Disqus