How to use local packages in Composer: a guide for PHP developers
dev.to·2d·
Discuss: DEV
🎼Composer
Preview
Report Post

When working on a PHP project, it’s common to rely on external libraries published on Packagist. Composer makes installing and managing these dependencies effortless. But what if you need to work with a dependency locally, outside Packagist?

For example, maybe you’re building a project that depends on a library, and you want to test changes in that library immediately, without having to publish a new version or push to GitHub every time. Composer’s repositories option lets you do exactly that: override a dependency with a local directory on your machine.

In this article, we’ll walk through a practical scenario and explain why this workflow is useful, how to set it up, and which situations it solves.

The Scenario

You’re developing a PHP project that depends on:

{
"requir...

Similar Posts

Loading similar posts...