Recently I had an issue where I switched packages and realized only in production, that a package I use was only available in dev as a dependency and was now missing. Now I found a way to prevent this in the future.

There is a tool called composer-require-checker which would have helped me because it lists all packages used but not directly required by composer.

And there is also a tool which does the opposite, meaning it shows all required packages which aren't used called composer unused.

I will now use them for all projects and can highly recommend them.