Interactive Books' Atelier's blog

How are you?

Requiring local composer package

9 months ago | Tutorial

The way to link to a local, in-development package is to first add in your main project's composer.json a repository, like this:

"repositories": [
    {
        "type": "path",
        "url": "/full/or/relative/path/to/development/package"
    }
]

You also need to either have a version specified in your development package's composer.json or the way I do it is to require the package using @dev, like this:

composer require "vendorname/packagename @dev"

It should output:

- Installing vendor/packagename (dev-develop)
Symlinked from /full/or/relative/path/to/development/package

Source: https://stackoverflow.com/questions/29994088/composer-require-local-package