PHP code example of huangdijia / laravel-trigger

1. Go to this page and download the library: Download huangdijia/laravel-trigger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

huangdijia / laravel-trigger example snippets


namespace App\Listeners;

use Huangdijia\Trigger\EventSubscriber;
use MySQLReplication\Event\DTO\UpdateRowsDTO;
use MySQLReplication\Event\DTO\DeleteRowsDTO;
use MySQLReplication\Event\DTO\WriteRowsDTO;

class ExampleSubscriber extends EventSubscriber
{
    public function onUpdate(UpdateRowsDTO $event)
    {
        // Handle UPDATE events
    }

    public function onDelete(DeleteRowsDTO $event)
    {
        // Handle DELETE events
    }

    public function onWrite(WriteRowsDTO $event)
    {
        // Handle INSERT events
    }