How to install a specific version of package using Composer?

And how to get list of all installed packages along with version in composer?

Panjeh
1 min readNov 5, 2019
composer require vendor/package:version

Like :

composer require guzzlehttp/guzzle:6.3.3

This is very important when you are going to migrate one module of codes from one application to another application and want to have the same version installed in the new place.

How to get list of all installed packages along with version in composer?

Just use

composer show 

And you can also use the global instalation of composer:

composer global show

Can we diagnose installed packages?

Yes sure!

We can run following

composer diagnose

Let’s run that.

As you see there is a warning! Since we use exact version of guzzle and we have to use semantic versioning for guzzle.

For solving this problem I just replace ~6.0 with 6.3.3 in composer.json and do following to upgrade guzzlehttp

composer update guzzlehttp/guzzle

I would like to introduce two packages for Laravel that I have recently developed: Laravel Pay Pocket, a modern multi-wallet package, and Laravel Failed Jobs, a UI for the Laravel Failed Jobs Table. I hope they may be of help to you.

https://github.com/HPWebdeveloper/laravel-pay-pocket
https://github.com/HPWebdeveloper/laravel-failed-jobs

--

--