Note sure why you need that as VCS? Can;t you remote the VCS block and do a:
composer require pixelairport/platform-api2
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I still try to learn more about composer. I found out how to use "path" type to load local package with symlink in composer. When i do "vcs" type I can load the package from my github account. Now I don't understand how my composer.json should look like.
I want to switch between them, that my local packages still uses my local packages, but when I do "composer install" in production, the packages should be loaded and used in vendor. Is that possible or do I have to change the composer.json each time?
That is what I have for local package:
{
"type": "path",
"url": "packages/pixelairport/platform-api2",
"options": {
"symlink": true
}
}
And that is what I need for production.
{ "type": "vcs", "url": "https://github.com/pixelairport/platform-api2.git" },
How can I have both in one composer.json that the local version is maybe only used when the directory exists?
....
It works :) This is how i load my package from git.
{
"type":"package",
"package": {
"type": "package",
"name": "pixelairport/platform-api2",
"version":"1.0",
"source": {
"url": "https://github.com/pixelairport/platform-api2.git",
"type": "git",
"reference":"1.0"
},
"autoload": {
"psr-4": {
"Pixelairport\PlatformApi2\": "src"
}
}
}
}
I also set the psr-4 for my autoloader. it seems when it is not a composer package from packagist, it dont use the composer file of the package. So i do it here. Not sure if I'm wrong. I just write it if someone else have the problem. Maybe this helps...
To load a provider I had to add it in config/app.php because of the not loaded composer file. Here is the post where i read it: https://likegeeks.com/install-and-use-non-composer-laravel-packages/
Thx also @robstar for your help. Now it works like I hoped it would be.
Please or to participate in this conversation.