Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!

Some awesome composer tricks

Composer really needs no introduction. At this point the PHP community pulled in billions of packages. Here are some Composer options that are not so well known.

You can view the versions of all the packages in your project by running composer show -i. Let’s try it out in our Blender Laravel template:

composer -i

Want to see all the dependencies of the installed packages in a tree? Then run composer show -t:

composer -t

If you need help using a specific package then you can open it’s documentation in a browser using composer. Try running composer home spatie/laravel-fractal to see it in action.

Know some other nice Composer tricks? Let me know in the comments below.

Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this blog. When not coding he’s probably rehearsing with his kraut rock band. He loves waffles and butterflies.
  • One that I often find useful when building packages, is validation of the composer.json file:
    composer validate

  • Clark

    The show dep one should be composer show -ti