PHP code example of mohamedmohamedhekal / hookrelay

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

    

mohamedmohamedhekal / hookrelay example snippets


use Hekal\HookRelay\Models\WebhookEndpoint;
use Hekal\HookRelay\Facades\HookRelay;

WebhookEndpoint::create([
    'name' => 'Merchant A',
    'url' => 'https://merchant.example/webhooks',
    'secret' => 'whsec_...',
    'events' => ['order.created', 'order.updated'],
]);

HookRelay::dispatch('order.created', [
    'id' => 1001,
    'total' => 2500,
], idempotencyKey: 'order:1001:created');
bash
composer vendor:publish --tag=hookrelay-config
php artisan migrate
bash
php artisan hookrelay:replay {id|uuid}
php artisan hookrelay:process-due