PHPackages                             digitlimit/githook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. digitlimit/githook

ActiveLibrary[API Development](/categories/api)

digitlimit/githook
==================

A Laravel package to handle GitHub webhooks seamlessly by dispatching Laravel events for all GitHub events. Users can listen to and handle these events easily.

v2.0.2(1y ago)56621MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Oct 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/digitlimit/githook)[ Packagist](https://packagist.org/packages/digitlimit/githook)[ Docs](https://github.com/digitlimit/githook)[ RSS](/packages/digitlimit-githook/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (10)Used By (0)

Githook
=======

[](#githook)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e6989f81a953b2d1ce6d8f879d04006ada9bd137f26e4659eb5ca8478af02dc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64696769746c696d69742f676974686f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/digitlimit/githook)[![Total Downloads](https://camo.githubusercontent.com/af66cf2f8c0b3e7623f5a25302172dd2a669411b432d5a3a4dc4c35f8e467651/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64696769746c696d69742f676974686f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/digitlimit/githook)[![GitHub Actions](https://github.com/digitlimit/githook/actions/workflows/githook.yml/badge.svg)](https://github.com/digitlimit/githook/actions/workflows/githook.yml/badge.svg)[![PHP versions](https://camo.githubusercontent.com/6d11d6d856087de79946baccbc02e10f07f3fef6ddea853f09eb3af66e7386a3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e30253230253743253230382e32253230253743253230382e332d626c75652e737667)](https://camo.githubusercontent.com/6d11d6d856087de79946baccbc02e10f07f3fef6ddea853f09eb3af66e7386a3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e30253230253743253230382e32253230253743253230382e332d626c75652e737667)

A Laravel package to handle GitHub webhooks seamlessly by dispatching Laravel events for all GitHub events. Users can listen to and handle these events easily.

[![image](https://private-user-images.githubusercontent.com/2041419/384955190-2390e740-96bd-4c3f-b848-60beee43674a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxMzk5NTUsIm5iZiI6MTc3NDEzOTY1NSwicGF0aCI6Ii8yMDQxNDE5LzM4NDk1NTE5MC0yMzkwZTc0MC05NmJkLTRjM2YtYjg0OC02MGJlZWU0MzY3NGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMjJUMDAzNDE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTcxMGRkZDQxMDJhNTMxNmE2NzhiYzllYjgwNzdiMTg3YTg3NTYxNzQ5NTA2MTVkMjM4MWEwM2FkMWVkNGUzOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XsAtmlIC47TE6HMJaroHUt70V2cfimEeHLepBvhztf0)](https://private-user-images.githubusercontent.com/2041419/384955190-2390e740-96bd-4c3f-b848-60beee43674a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxMzk5NTUsIm5iZiI6MTc3NDEzOTY1NSwicGF0aCI6Ii8yMDQxNDE5LzM4NDk1NTE5MC0yMzkwZTc0MC05NmJkLTRjM2YtYjg0OC02MGJlZWU0MzY3NGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMjJUMDAzNDE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTcxMGRkZDQxMDJhNTMxNmE2NzhiYzllYjgwNzdiMTg3YTg3NTYxNzQ5NTA2MTVkMjM4MWEwM2FkMWVkNGUzOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XsAtmlIC47TE6HMJaroHUt70V2cfimEeHLepBvhztf0)

Installation
------------

[](#installation)

To install the package, use Composer:

```
composer require digitlimit/githook
```

Configuration
-------------

[](#configuration)

Publish Configuration File To publish the configuration file, run:

```
php artisan vendor:publish --provider="Digitlimit\Githook\GithookServiceProvider"
```

Configure Environment Variables
-------------------------------

[](#configure-environment-variables)

Add the following environment variables to your .env file:

```
GITHOOK_SECRET=your-github-webhook-secret

```

Available Events
----------------

[](#available-events)

Here are the events you can subscribe to:

```
use Digitlimit\Githook\Events\BranchProtectionConfiguration;
use Digitlimit\Githook\Events\BranchProtectionRule;
use Digitlimit\Githook\Events\CheckRun;
use Digitlimit\Githook\Events\CheckSuite;
use Digitlimit\Githook\Events\CodeScanningAlert;
use Digitlimit\Githook\Events\CommitComment;
use Digitlimit\Githook\Events\Create;
use Digitlimit\Githook\Events\CustomProperty;
use Digitlimit\Githook\Events\CustomPropertyValues;
use Digitlimit\Githook\Events\Delete;
use Digitlimit\Githook\Events\DependabotAlert;
use Digitlimit\Githook\Events\DeployKey;
use Digitlimit\Githook\Events\Deployment;
use Digitlimit\Githook\Events\DeploymentProtectionRule;
use Digitlimit\Githook\Events\DeploymentReview;
use Digitlimit\Githook\Events\DeploymentStatus;
use Digitlimit\Githook\Events\Discussion;
use Digitlimit\Githook\Events\DiscussionComment;
use Digitlimit\Githook\Events\Fork;
use Digitlimit\Githook\Events\GithubAppAuthorization;
use Digitlimit\Githook\Events\Gollum;
use Digitlimit\Githook\Events\Installation;
use Digitlimit\Githook\Events\InstallationRepositories;
use Digitlimit\Githook\Events\InstallationTarget;
use Digitlimit\Githook\Events\IssueComment;
use Digitlimit\Githook\Events\Issues;
use Digitlimit\Githook\Events\Label;
use Digitlimit\Githook\Events\MarketplacePurchase;
use Digitlimit\Githook\Events\Member;
use Digitlimit\Githook\Events\Membership;
use Digitlimit\Githook\Events\MergeGroup;
use Digitlimit\Githook\Events\Meta;
use Digitlimit\Githook\Events\Milestone;
use Digitlimit\Githook\Events\OrgBlock;
use Digitlimit\Githook\Events\Organization;
use Digitlimit\Githook\Events\Package;
use Digitlimit\Githook\Events\PageBuild;
use Digitlimit\Githook\Events\PersonalAccessTokenRequest;
use Digitlimit\Githook\Events\Ping;
use Digitlimit\Githook\Events\Project;
use Digitlimit\Githook\Events\ProjectCard;
use Digitlimit\Githook\Events\ProjectColumn;
use Digitlimit\Githook\Events\ProjectsV2;
use Digitlimit\Githook\Events\ProjectsV2Item;
use Digitlimit\Githook\Events\ProjectsV2StatusUpdate;
use Digitlimit\Githook\Events\PublicEvent;
use Digitlimit\Githook\Events\PullRequest;
use Digitlimit\Githook\Events\PullRequestReview;
use Digitlimit\Githook\Events\PullRequestReviewComment;
use Digitlimit\Githook\Events\PullRequestReviewThread;
use Digitlimit\Githook\Events\Push;
use Digitlimit\Githook\Events\RegistryPackage;
use Digitlimit\Githook\Events\Release;
use Digitlimit\Githook\Events\Repository;
use Digitlimit\Githook\Events\RepositoryAdvisory;
use Digitlimit\Githook\Events\RepositoryDispatch;
use Digitlimit\Githook\Events\RepositoryImport;
use Digitlimit\Githook\Events\RepositoryRuleset;
use Digitlimit\Githook\Events\RepositoryVulnerabilityAlert;
use Digitlimit\Githook\Events\SecretScanningAlert;
use Digitlimit\Githook\Events\SecretScanningAlertLocation;
use Digitlimit\Githook\Events\SecurityAdvisory;
use Digitlimit\Githook\Events\SecurityAndAnalysis;
use Digitlimit\Githook\Events\Sponsorship;
use Digitlimit\Githook\Events\Star;
use Digitlimit\Githook\Events\Status;
use Digitlimit\Githook\Events\SubIssues;
use Digitlimit\Githook\Events\Team;
use Digitlimit\Githook\Events\TeamAdd;
use Digitlimit\Githook\Events\Watch;
use Digitlimit\Githook\Events\WorkflowDispatch;
use Digitlimit\Githook\Events\WorkflowJob;
use Digitlimit\Githook\Events\WorkflowRun;
use Digitlimit\Githook\Events\Generic;

```

Subscribing to Events
---------------------

[](#subscribing-to-events)

You can subscribe to events either in the Laravel Event Service Provider or directly in the configuration file.

Using Event Service Provider
----------------------------

[](#using-event-service-provider)

To subscribe to events in the Event Service Provider, add the following to your app/Providers/EventServiceProvider.php:

```
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Digitlimit\Githook\Events\Star;
use App\Listeners\HandleStar;

class EventServiceProvider extends ServiceProvider
{
    protected $listen = [
        Star::class => [
            HandleStar::class,
        ],
    ];

    public function boot()
    {
        parent::boot();
    }
}

```

Using the Configuration File
============================

[](#using-the-configuration-file)

Alternatively, you can subscribe to events directly in the configuration file `config/githook.php`:

```
return [
    'events' => [
        'star' => [
            'event' => Events\Star::class,
            'listeners' => [
                \App\Listeners\HandleStar::class,
            ],
        ],
    ],
    ...
];

```

Example Listener
----------------

[](#example-listener)

Here is an example listener for the `Star` event:

```
namespace App\Listeners;

use Digitlimit\Githook\Events\Star;

class HandleStar
{
    public function handle(Star $event)
    {
        // Handle the event
    }
}

```

How to setup webhook in GitHub
------------------------------

[](#how-to-setup-webhook-in-github)

1. Setup Github Webhook if you have not done so.

[![image](https://user-images.githubusercontent.com/2041419/137665069-f330f1e5-3907-4e59-a6b3-79c95be40ba0.png)](https://user-images.githubusercontent.com/2041419/137665069-f330f1e5-3907-4e59-a6b3-79c95be40ba0.png)

### Testing

[](#testing)

```
composer install
php vendor/bin/testbench package:test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Emeka Mbah](https://github.com/digitlimit)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~122 days

Total

4

Last Release

546d ago

Major Versions

v1.0.0 → v2.0.02024-11-08

PHP version history (3 changes)v1.0.0PHP ^7.0|^8.0

v2.0.0PHP ^8.1

v2.0.1PHP ^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/8110f350724a5628a90e5b3aae48eb1507573aef8c8383a78fefe8a03a34b57a?d=identicon)[digitlimit](/maintainers/digitlimit)

---

Top Contributors

[![digitlimit](https://avatars.githubusercontent.com/u/2041419?v=4)](https://github.com/digitlimit "digitlimit (126 commits)")

---

Tags

github-webhookslaravellaravel-eventslaravel-githublaravelgithubwebhookgithooklaravel-eventsdigitlimitlaravel listenerslisten for github eventsgithub eventsgithub webhookgithub webhook eventsgithub webhook listenerlaravel github webhook

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/digitlimit-githook/health.svg)

```
[![Health](https://phpackages.com/badges/digitlimit-githook/health.svg)](https://phpackages.com/packages/digitlimit-githook)
```

###  Alternatives

[mpociot/captainhook

Add webhooks to your Laravel app.

3358.9k](/packages/mpociot-captainhook)[kayedspace/laravel-n8n

A complete, expressive, and fluent Laravel client for the n8n public REST API and Webhooks Triggering.

1376.2k1](/packages/kayedspace-laravel-n8n)[phpsa/laravel-postman

Export laravel API routes to postman

1014.7k](/packages/phpsa-laravel-postman)[gnello/webhook-manager

Easily associate one or more actions with a specific repository event using webhooks

115.9k](/packages/gnello-webhook-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
