Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

inyansuta's avatar

Composer local repository only on local

I have my own github repository, from which I draw on my own projects. At the local station I use this repository locally so I do not have to do the composer install after every change in the repository ...

     "repositories": [
         {
             "type": "path"
             "url": "../../github/helper"
         }
     ],
     "require": {
         "petrzavicak/helper": "@dev"
     },

In this case, the "petrzavicak / helper" package is retrieved from the local location "github / helper".

The question is how on live server to get package loaded normally from https://packagist.org (from github)? Of course, when I remove the local repository in composer.json, then require load correctly from githubu ... Then again, the local repository does not work .. I'm slightly confused. Thanks for the help.

0 likes
1 reply
manelgavalda's avatar

I think you can use the franzliedke/studio package (https://github.com/franzliedke/studio). You can install it with --dev so it will only work on your local environment, and pull the package from packagist in your server. From the readme:

This is what will happen under the hood:

Composer begins checking dependencies for updates.

Studio jumps in and informs Composer to prefer packages from the directories listed in the studio.json file over downloading them from Packagist.

Composer symlinks these packages into the vendor directory or any other appropriate place (e.g. for custom installers). Thus, to your application, these packages will behave just like "normal" Composer packages.

Composer generates proper autoloading rules for the Studio packages.

For non-Studio packages, Composer works as always.

1 like

Please or to participate in this conversation.