I have pushed a public package on my github. But now I can't require that package to my project as normal, I must specify dev-master version for finding it. I have tried to set "minimum-stability" : "stable", but It does not work. Also I have created release v0.1 with path to master branch.
What can I do for using my package just ran composer require <vendor>/<package> command?
My composer.json file:
{
"name": "miragepresent/likeable",
"description": "Quick likes support",
"keywords": ["likes support", "laravel", "eloquent", "like", "likes relation", "likeable"],
"license": "MIT",
"support": {
"issues": "https://github.com/MiragePresent/Likeable/issues",
"source": "https://github.com/MiragePresent/Likeable"
},
"authors": [
{
"name": "David Holovii",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"MiragePresent\\Likeable\\": "src/"
}
},
"require": {
"php": ">=7.0"
},
"extra": {
"laravel": {
"providers": [
"MiragePresent\\Likeable\\LikeableServiceProvider"
]
}
},
"minimum-stability": "stable"
}
Steps to add a public composer package.
Develop your package, and make sure you have a composer.json
{
"name": "vendor/package",
"description": "My awesome package",
"license": "MIT",
"keywords": ["awesome","keywords"],
"homepage": "https://github.com/vendor/package",
"authors": [
{
"name": "Mr Developer",
"email": "[email protected]",
"homepage": "http://example.com/"
}
],
"support": {
"email": "[email protected]"
},
"require": {
"additional/package": ">=0.1"
},
"autoload": {
"psr-4": {
"Package\\Namespace\\": "src"
}
}
}
Then push your code to your VCS.
Sign up to https://packagist.org and list it, by clicking Submit and entering your packages VCS url in the input box. Submit it and correct any errors thrown.

Once the package is added, go to your account and grab your API key: https://packagist.org/profile/
Then add a service on the VCS (github) so new tags notify packagist.
https://github.com/vendor/package/settings/installations


Then once complete, you should create a tag of your package:
git tag -a v0.0.1 -m "First release"
Then push that tag to the VCS:
git push origin v0.0.1
Then anyone can install your package simply by doing:
composer require vendor/package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With