PHP code example of doohlabs / yii2-webhooks

1. Go to this page and download the library: Download doohlabs/yii2-webhooks 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/ */

    

doohlabs / yii2-webhooks example snippets


'bootstrap' => [
    // ...
    'webhooks'
],

'modules' => [
    // ...
    'webhooks' => [
        'class' => 'doohlabs\webhooks\Module',
        'allowedModels' => [
            'app\models\Model1',
            'app\models\Model2',
        ],
        'allowedEvents' => [
            'EVENT_AFTER_DELETE',
            'EVENT_AFTER_INSERT',
            'EVENT_AFTER_UPDATE',
        ],
        'timeout' => 30,
    ],
],

Event::trigger(Example::class, Example::EVENT_EXAMPLE, new Event(['sender' => $model]));

'modules' => [
    // ...
    'webhooks' => [
        'class' => 'doohlabs\webhooks\Module',
        'eventDispatcherComponentClass' => 'app\components\MyDispatcher',
    ],
],
bash
php yii migrate --migrationPath=@doohlabs/webhooks/migrations