How to "composer require" a Specific PHP Package Version?

Find out how you can specify a specific PHP package version with composer require

When using the composer require command, you can specify the version for a package right after the package name, separated by a colon (:), like so:

composer require vendor/package:version

For example, to specify the exact version number for, let's suppose the designcise/bitframe package, you would do the following:

composer require designcise/bitframe:3.5.0

You can of course specify any version or constraints as you would in your composer.json files. For example, to specify a caret version range you would do the following:

composer require designcise/bitframe:^3.5

Hope you found this post useful. It was published . Please show your love and support by sharing this post.