How to use a fork of a Composer Package

1. Fork the Git Repository on Github

2. Make changes in a branch

For this example I’ll use the branch will be named mybranch

3. Add repositories entry in composer.json

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/yourgithubuser/packagename",
        "no-api": true
    }
],

⚠️ If you get an error like “GitHub API limit (0 calls/hr) is exhausted, could not fetch”? make sure you have the "no-api": true configuration specified.

4. Require custom version in Composer

Require the package with

composer require vendor/packagename:dev-mybranch

ℹ To avoid conflicts with other packages, you can alias your branch as a specific version composer require "vendor/packagename:dev-mybranch as 1.0.0"