Get "PHP 8 in a Nuthshell" (Now with PHP 8.4)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

Know why certain composer packages are installed in your project

Ever wondered why certain packages are installed in your project when looking into your project’s “vendor” folder?

Well, the reason is that these packages are dependencies of the packages that you have installed in your project. But what if you want to know why a certain package is installed in your project?

You can use the why command of the composer to know why a certain package is installed in your project.

For instance, let’s say you want to know why the egulias/email-validator package is installed in your project. You can do so by running the following command in your project.

$ composer why egulias/email-validator

This will give you the following output.

composer shw

As you can see, the egulias/email-validator package is installed in your project because the laravel/framework and symfony/mailer packages require it.

Like this article?

Buy me a coffee

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?