Composer "Show" As A Sanity Check
I have found that when upgrading or installing Composer packages, it is always useful to do a quick sanity check by running:
$ composer show
This command will list out all the available packages you have installed for your project.
It has been particularly useful when running through a Laravel framework upgrade. If I just want to confirm that the correct pacakge for the upgrade was installed or if I am seeing some wonky behavior, I first check to ensure the installed packages are the correct version and what I am expecting to see.
When running the command (depending on your project) the list can get pretty long, but you can filter it by passing an argument to the command:
# Passing package provider and wildcard:
$ composer show laravel/*
# Command outputs:
laravel/breeze v1.4.1 Minimal Laravel authentication scaffolding with Blade and Tailwind.
laravel/framework v8.60.0 The Laravel Framework.
laravel/tinker v2.6.1 Powerful REPL for the Laravel framework.
# Passing provider name and package name:
$ composer show laravel/tinker
# Command outputs:
name : laravel/tinker
descrip. : Powerful REPL for the Laravel framework.
keywords : REPL, Tinker, laravel, psysh
versions : * v2.6.1
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source : [git] https://github.com/laravel/tinker.git 04ad32c1a3328081097a181875733fa51f402083
dist : [zip] https://api.github.com/repos/laravel/tinker/zipball/04ad32c1a3328081097a181875733fa51f402083 04ad32c1a3328081097a181875733fa51f402083
path : /home/vagrant/Code/portfolio-code/vendor/laravel/tinker
names : laravel/tinker
support
issues : https://github.com/laravel/tinker/issues
source : https://github.com/laravel/tinker/tree/v2.6.1
autoload
psr-4
Laravel\Tinker\ => src/
requires
illuminate/console ^6.0|^7.0|^8.0
illuminate/contracts ^6.0|^7.0|^8.0
illuminate/support ^6.0|^7.0|^8.0
php ^7.2.5|^8.0
psy/psysh ^0.10.4
symfony/var-dumper ^4.3.4|^5.0
requires (dev)
mockery/mockery ~1.3.3|^1.4.2
phpunit/phpunit ^8.5.8|^9.3.3
suggests
illuminate/database The Illuminate Database package (^6.0|^7.0|^8.0).
There are a number of useful flags you can pass to the command, so check out the docs to learn more!