How to install a specific version of a software package with Composer
This article will explain in detail how to use Composer to install a specific version of the software package, Xiaobian feels quite practical, so share it with you as a reference, I hope you can gain something after reading this article.
This is a short quick article on how to install a specific version of a package using Composer
TL;DR version
composer require vendor/package:version//Examplecomposer require laravel/passport:6.0
detailed edition
Navigate to the project root directory at the terminal and install a specific version of the package using Composer by executing the following command
Suppose you want to install version 6.0.0 of the larvael/passport package into your project instead of installing the latest version. Then you should execute the following command
composer require laravel/passport:6.0.0
Add double quotes to use caret or tilde operators in version numbers.
for example
composer require middlewares/whoops "^0.4"
Wave version range (~) - ~1.2.3 corresponds to>=1.2.3 =1.2.3