Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Using Github Webhooks with PHP
Apr 08, 2015 @ 15:16:21

The SitePoint PHP blog has a new tutorial posted from Younes Rafie continuing their series about using the GitHub API from PHP. In this second part of the series he shows how to integrate the GitHub Webhooks with your applications.

In the first part of our series, we talked about the Github API and built a demo in the process. In this part we are going to explore the Webhooks API, and we will build a demo to showcase the API usage.

The demo application they set up gets a push request from the GitHub API and save the resulting data to a local database. They use Laravel 5 to build the application but it could easily be in any other framework (or just plain PHP). They're also deploying to Heroku, but again, you can use your own service. The article then shows you how to go and register a webhook in the repository on the GitHub site and create the "hooks" table to store the event name and contents of the request. He makes use of a JSON output route and the ChartsJs library to render a simple bar graph of the contributors to the repository based on the number of commits they've made.

tagged: tutorial series part2 github webhooks api laravel5 chartsjs json

Link: http://www.sitepoint.com/using-github-webhooks-php/


Trending Topics: