June 23, 2017 at 5:25 pm

Install new dependencies

If you would like to install dependencies in laravel there are 2 ways to do so, you can either open up your composer.json file and edit it to put in the dependencies you would like to include inside your project. This is an example of what can be found inside my composer.json file:

"require": {
	"laravel/framework": "4.2.*"
"require-dev": {
	"way/generators": "~3.0",
	"codeception/codeception": "~2.0"

In the require you need to put every package required at all time, in require-dev you should put everything you would also require during development or testing. Therefor codeception is in there, as I only use that during development.

If you prefer to install dependencies this way you should run one of these commands, depending if you are in production or not:

composer update
composer update --dev

Another way is to install these packages right from your terminal window. For that you would use the following command:

composer require codeception/codeception

This will automatically install the package as well as update the composer.json file. Here you could also use --dev to add this as a development & testing only package.

To find more packages you can always visit Packagist which is a nice library of packages found online.

0 likes composer , laravel 5 , packages , packagist
Share: / / /