Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

BenSmith's avatar

Quickly find the version number of a composer package

I often need to find the most recent version of a package. Rather than open up packagist, add the following to your .bashrc file (or similar):

alias ver='function _versions() { composer show $1 | grep versions }; _versions'

We can now run ver package name to get a list of versions:

$ ver illuminate/html
versions : * dev-master, 5.0.x-dev, 4.2.x-dev, v4.2.9, v4.2.8, v4.2.7, v4.2.6, v4.2.5, v4.2.4, v4.2.3, v4.2.2, v4.2.1, v4.2.0-BETA1, 4.1.x-dev, v4.1.30, v4.1.29, v4.1.28, v4.1.27, v4.1.26, v4.1.25, v4.1.24, v4.1.23, v4.1.22, v4.1.21, v4.1.20, v4.1.19, v4.1.18, v4.1.17, v4.1.16, v4.1.15, v4.1.14, v4.1.13, v4.1.12, v4.1.11, v4.1.10, v4.1.9, v4.1.8, v4.1.7, v4.1.6, v4.1.5, v4.1.4, v4.1.3, v4.1.2, v4.1.1, v4.1.0, 4.0.x-dev, v4.0.10, v4.0.9, v4.0.8, v4.0.7, v4.0.6, v4.0.5, v4.0.4, v4.0.3, v4.0.2, v4.0.1, v4.0.0, v4.0.0-BETA4
0 likes
3 replies
bashy's avatar

Used this when you (I think) posted it before :) thanks

JeffreyWay's avatar

Quick note that if you update Composer...

composer self-update

You can simply do...

composer require illuminate/html

And that'll give you the latest version automatically. You won't have to specify a version like you used to.

1 like
bashy's avatar

That's a cool addition to the above command. I for one like to see the versions quickly, I've wanted to use an older one before and this came in handy.

1 like

Please or to participate in this conversation.