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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help