{"id":23426927,"url":"https://github.com/nxtlvlsoftware/laravel-github-webhooks","last_synced_at":"2026-04-10T23:03:13.188Z","repository":{"id":57029476,"uuid":"176705201","full_name":"NxtLvLSoftware/laravel-github-webhooks","owner":"NxtLvLSoftware","description":"A package to make github webhook handling in your laravel application a breeze.","archived":false,"fork":false,"pushed_at":"2019-03-22T08:14:08.000Z","size":94,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T06:30:12.446Z","etag":null,"topics":["api","app","apps","github","laravel","package","php","webhooks"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NxtLvLSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-20T10:02:47.000Z","updated_at":"2019-03-22T08:14:09.000Z","dependencies_parsed_at":"2022-08-23T17:41:04.688Z","dependency_job_id":null,"html_url":"https://github.com/NxtLvLSoftware/laravel-github-webhooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NxtLvLSoftware%2Flaravel-github-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NxtLvLSoftware%2Flaravel-github-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NxtLvLSoftware%2Flaravel-github-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NxtLvLSoftware%2Flaravel-github-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NxtLvLSoftware","download_url":"https://codeload.github.com/NxtLvLSoftware/laravel-github-webhooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248037295,"owners_count":21037325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","app","apps","github","laravel","package","php","webhooks"],"created_at":"2024-12-23T06:14:47.096Z","updated_at":"2026-04-10T23:03:08.150Z","avatar_url":"https://github.com/NxtLvLSoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Laravel GitHub Webhooks\n===============\n_Make github webhook handling in your laravel application a breeze._\n\n[![Build Status](https://travis-ci.org/NxtLvLSoftware/laravel-github-webhooks.svg?branch=master)](https://travis-ci.org/NxtLvLSoftware/laravel-github-webhooks)\n\n### About\n\nThis package provides container injection and controller like handling for each github webhook event available. Out of the\nbox you can generate a handler for an event with the `php artisan make:gh-webhook {event}` command, this will create a class\nunder `Http/Webhooks/GitHub` with the corresponding event name and a separate method for each action the webhook will notify\nyou of.\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Webhooks\\GitHub;\n\nuse nxtlvlsoftware\\githubwebhooks\\handler\\ForkHandler as Handler;\nuse nxtlvlsoftware\\githubwebhooks\\payload\\WebhookPayload;\n\nclass ForkHandler extends Handler\n{\n    protected function forked(WebhookPayload $payload): void\n    {\n        //\n    }\n}\n```\n\nYou should then make sure you register the directory of handlers your application provides by calling `GitHubWebhooks::registerFromDir();`\nfrom a service providers boot method. If you customized where your handlers are generated you can also pass the correct\ndirectory to the register method: `GitHubWebhooks::registerFromDir('Http/Github');`\n\nYou can list all available/supported github webhook events with the `php artisan github-webhook:list` command.\n\n### Installation\n\nAll you have to do to install with composer is the following:\n\n```bash\n$ composer require nxtlvlsoftware/laravel-github-webhooks\n```\n\nOr add it directly to your composer.json manifest:\n\n```json\n{\n    \"require\": {\n        \"nxtlvlsoftware/laravel-github-webhooks\": \"*\"\n    }\n}\n```\n\nComposer will automatically handle registering the service provider and facade for you, but you can also register these\nmanually if you wish.\n\nYou can then publish the migration file for creating the webhook events table:\n```bash\n$ php artisan vendor:publish --provider=\"nxtlvlsoftware\\githubwebhooks\\GitHubWebhooksServiceProvider\" --tag=\"migrations\"\n```\n\nYou can also optionally publish the config file if you don't want to define your webhook secret in your .env file:\n```bash\n$ php artisan vendor:publish --provider=\"nxtlvlsoftware\\githubwebhooks\\GitHubWebhooksServiceProvider\" --tag=\"config\"\n```\n\n### Usage\n\nYou should register a POST API route that looks something like `https://myapp.com/api/webhook/github` and configure your\ngithub application with this webhook url. This package provides a helper method for defining this route, add this to your api.php file:\n\n```php\nRoute::githubWebhooks();\n```\n\nThis will register a route at `github/webhook` by default. You may pass a custom route name as the first parameter and the\nmacro will respect nested group route rules.\n\nIf a webhook is received that there is no handler configured for, the request will throw a `Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`\nthat will cause the webhook delivery to fail with a 404 error and no job will be dispatched.\n\nIf there is a handler configured for the event and the signature is successfully verified then a new model will be inserted\ninto the `github_webhook_events` table with the event name, payload and information on the last jobs status. When the job\nfinished it will update the model and set the `handled` attribute to true and remove any failure information. If the job\nencounters an error while handling the event then the model will be updated with the exception information and have the `failed`\nattribute marked as true.\n\nThis package does not automatically delete handled webhook event data from the database as you may find it useful to re-schedule\nfailed event handler jobs in production or just run the handler again in a development environment.\n\n#### Setting the payload type\n\nYou should set the webhook payload type that which you're expecting (the default is currently array payloads):\n```php\nGitHubWebhooks::useObjectPayloads(); // payload will be \\stdObject\nGitHubWebhooks::useArrayPayloads(); // payload will be an array\n```\n\nYou can also implement your own payload class if you want to accept another format or parse the json differently:\n```php\nGitHubWebhooks::usePayload(YourPayload::class);\n```\n\n### Issues\n\nFound a problem with this laravel github webhooks? Make sure to open an issue on the [issue tracker](https://github.com/NxtLvLSoftware/laravel-github-webhooks/issues)\nand we'll get it sorted!\n\n#\n\n__The content of this repo is licensed under the Unlicense. A full copy of the license is available [here](LICENSE).__","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxtlvlsoftware%2Flaravel-github-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnxtlvlsoftware%2Flaravel-github-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxtlvlsoftware%2Flaravel-github-webhooks/lists"}