Adding a non-Packagist package to Composer
Adding a single line to our composer.json
file and having Composer automatically download and install a package is great, but it requires the package to be available on packagist.org. In this recipe, we'll see how to install packages that aren't available on Packagist.
Getting ready
For this recipe, we'll need a standard Laravel installation.
How to do it...
To complete this recipe, follow these steps:
On GitHub, we'll need to find a package we want to use. For this example, we'll use the
UniversalForms
package found at https://github.com/wesleytodd/Universal-Forms-PHP.Open our main
composer.json
file and update therequire
section as follows:"require": { "laravel/framework": "4.0.*", "wesleytodd/universal-forms": "dev-master" },
In
composer.json
, under therequire
section, add the repository we want to use:"repositories": [ { "type": "vcs", "url": "https://github.com/wesleytodd/Universal-Forms-PHP" } ],
In...