I've developed a custom laravel package and put it on GitHub. I put it in composer.json (code below) and it installs fine.
I have no version info on it yet, since it is still in development. When I make changes to my package (in a separate directory), I commit and push the changes up to the GitHub repo.
When I run 'composer update', I get "nothing to install or update". If I delete the package from my vendors directory and update, then my package IS installed from the GitHub repo, with the latest changes.
But I would like to be able to pull/force the latest changes from the repo without deleting it first from my vendors directory, since I have other dependencies on that package, and if I delete it, I get errors from artisan clear-compiled that classes are not defined (since they are defined in my deleted vendor package...)
The relevant portion of my top-level composer.json is:
"repositories": [{
"type": "package",
"package": {
"name": "myrepo/MyExtension",
"version": "dev-master",
"source": {
"url": "https://github.com/myrepo/MyExtension.git",
"type": "git",
"reference": "master"
},
"autoload": {
"psr-4": {
"MyExtension\\": "src/Extensions/"
}
}
}
],
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"myrepo/MyExtension": "dev-master"
},
You have created all meta data about your package yourself, likely making Composer think that the data didn't change.
The easier, and probably working, way would be to simply point to the repository URL and let Composer query the meta data from the composer.json
file contained in the repository:
"repositories": [{
"type": "vcs",
"url": "https://github.com/myrepo/MyExtension.git"
}]
For it to update your changes you need to version your package but as you said earlier you are not versioning your packages so for it to update your changes you can go to composer.lock to remove your package entry or to use composer to remove the package and install it again. eg
// composer remove vendor/package && composer require vendor/package
composer remove zizaco/entrust && composer require zizaco/entrust
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