Last active
December 7, 2018 07:52
-
-
Save mookofe/d3ae82abb29218343679e713f0b60bcd to your computer and use it in GitHub Desktop.
Github Webhooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Route; | |
use Illuminate\Http\Request; | |
class GitHubController extends Controller | |
{ | |
/** | |
* Update ticket status depending on github action | |
* | |
* @param Request $request Basic Request | |
* | |
* @return void | |
*/ | |
public function gitHubUpdate(Request $request) | |
{ | |
$content = $request->getContent(); | |
$status = $request->get('action'); | |
$pullRequest = $request->get('pull_request'); | |
$pullBody = $pullRequest['body']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, Mookofe! I am used laravel 5.1. when I add webhook in GitHub, url is http://mywebsite/api/github. but it always said response 500.this is html response headers:
Cache-Control: no-cache, private
Connection: keep-alive
Content-Length: 13912
Content-Type: text/html
date: Mon, 27 Nov 2017 04:55:03 GMT
Server: nginx/1.4.6 (Ubuntu)
Transfer-Encoding: chunked
X-Powered-By: PHP/5.5.9-1ubuntu4.22
ok, I get it. because I forgot add $except = "api/github" in VerifyCsrfToken Middleware. Thank you!