Quick Tip: Composer & Github - Develop Packages Interactively

Originally published at: http://www.sitepoint.com/quick-tip-composer-github-develop-packages-interactively/

In this quick tip I will show you how to use Composer in conjunction with Github to ease your package development process.

Using Composer Repositories

Say you have a package hosted on Github, and want to develop it while using it in your project. After having your Github repository set up, you can use Composer repositories configuration to tell Composer about your code repository.
Let’s say I have a package on Github with a URL https://github.com/Whyounes/laravel5-twig/, and my package composer.json file looks like the following.

Continue reading this article on SitePoint

We’ve began using this approach on our internal packages. To make it even better, you can tag releases on Github and then specify that tag as the package version in place of dev-master, since being tied to master can be dangerous for production sites. Our basic workflow for this is:

git add -A
git commit -m 'add some cool new feature'
git tag 1.1.0 # Or whatever your new version is
git push origin master --tags

Now, you can require your package by that new version number.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.