How to link a Composer package for local development

Comprehensive guide on how to link a local composer package for development purposes.

How to link a Composer package for local development
16 May 2018
|
1 min read

1. (optional) Remove remote package

1composer remove author/package

2. Add local repository

Add the symlink option if your filesystem supports symlinks.

The url value can be the absolute or relative path to the package

 1{
 2    "repositories": [
 3        {
 4            "type": "path",
 5            "url": "/Users/author/Code/folder",
 6            "options": {
 7                "symlink": true
 8            }
 9        }
10    ]
11}

3. Require the package again

Be sure, to add the @dev version

1composer require author/package @dev


Read more...