PHPackages                             huangdijia/hyperf-trigger - 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. [Database &amp; ORM](/categories/database)
4. /
5. huangdijia/hyperf-trigger

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

huangdijia/hyperf-trigger
=========================

MySQL Trigger for hyperf.

0.1.2(5y ago)116MITPHP

Since Dec 30Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (8)Versions (4)Used By (0)

hyperf-trigger
==============

[](#hyperf-trigger)

[![Latest Stable Version](https://camo.githubusercontent.com/8d595eb615be52162e59c348cab8258ed8fc73c93ee35336ee0feacc921272a7/68747470733a2f2f706f7365722e707567782e6f72672f6875616e6764696a69612f6879706572662d747269676765722f76657273696f6e2e706e67)](https://packagist.org/packages/huangdijia/hyperf-trigger)[![Total Downloads](https://camo.githubusercontent.com/e0d17cd952f9199da7e32f709b382d004ac48a61ddda3635e08e09bda2d588d6/68747470733a2f2f706f7365722e707567782e6f72672f6875616e6764696a69612f6879706572662d747269676765722f642f746f74616c2e706e67)](https://packagist.org/packages/huangdijia/hyperf-trigger)[![GitHub license](https://camo.githubusercontent.com/35f0bd533c4f3bf808e7b5b76649ab9d79633a894d299ae61e4bb9e61a383a92/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6875616e6764696a69612f6879706572662d74726967676572)](https://github.com/huangdijia/hyperf-trigger)

MySQL trigger component for hyperf

⚠️ Move to [friendsofhyperf/trigger](https://github.com/friendsofhyperf/trigger)

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

[](#installation)

- Request

```
composer require huangdijia/hyperf-trigger
```

- Publish

```
php bin/hyperf.php vendor:publish huangdijia/hyperf-trigger
```

Costom Trigger
--------------

[](#costom-trigger)

```
namespace App\Trigger;

use Huangdijia\Trigger\Annotation\Trigger;
use Huangdijia\Trigger\Trigger\AbstractTrigger;
use MySQLReplication\Event\DTO\EventDTO;

/**
 * single
 * @Trigger(table="table" on="write", replication="default")
 * or multi events by array
 * @Trigger(table="table" on={"write", "update", "delete"}, replication="default")
 * or multi events by string
 * @Trigger(table="table" on="write,update,delete", replication="default")
 * or all events
 * @Trigger(table="table" on="*", replication="default")
 */
class SomeTableTrigger extends AbstractTrigger
{
    public function onWrite(array $new)
    {
        var_dump($new);
    }

    public function onUpdate(array $old, array $new)
    {
        var_dump($old, $new);
    }

    public function onDelete(array $old)
    {
        var_dump($old);
    }
}
```

Costom Subscriber
-----------------

[](#costom-subscriber)

```
namespace App\Subscriber;

use Huangdijia\Trigger\Annotation\Subscriber;
use Huangdijia\Trigger\Subscriber\AbstractEventSubscriber;
use MySQLReplication\Event\DTO\EventDTO;

/**
 * @Subscriber(replication="default")
 */
class DemoSubscriber extends AbstractEventSubscriber
{
    protected function allEvents(EventDTO $event): void
    {
        // some code
    }
}
```

Setup Process
-------------

[](#setup-process)

- Default

```
namespace App\Process;

use Huangdijia\Trigger\Process\ConsumeProcess;
use Hyperf\Process\Annotation\Process;

/**
 * @Process
 */
class TriggerProcess extends ConsumeProcess
{
}
```

- Custom replication

```
namespace App\Process;

use Huangdijia\Trigger\Process\ConsumeProcess;
use Hyperf\Process\Annotation\Process;

/**
 * @Process
 */
class CustomProcess extends ConsumeProcess
{
    protected $replication = 'custom_replication';
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~0 days

Total

3

Last Release

1957d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8337659?v=4)[Deeka Wong](/maintainers/huangdijia)[@huangdijia](https://github.com/huangdijia)

---

Top Contributors

[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (14 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/huangdijia-hyperf-trigger/health.svg)

```
[![Health](https://phpackages.com/badges/huangdijia-hyperf-trigger/health.svg)](https://phpackages.com/packages/huangdijia-hyperf-trigger)
```

###  Alternatives

[mineadmin/mineadmin

Quickly build a background management system for web applications

1.2k2.0k](/packages/mineadmin-mineadmin)[hyperf/swow-skeleton

A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.

514.5k](/packages/hyperf-swow-skeleton)[hyperf/odin

425.9k](/packages/hyperf-odin)[yumufeng/hyperf-mongodb

2116.0k](/packages/yumufeng-hyperf-mongodb)[huangdijia/laravel-trigger

MySQL trigger base on MySQLReplication.

325.4k](/packages/huangdijia-laravel-trigger)

PHPackages © 2026

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