PHP code example of custom-d / webhook-registry

1. Go to this page and download the library: Download custom-d/webhook-registry 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/ */

    

custom-d / webhook-registry example snippets


    /**
     * Get the payload for this webhook event
     */
    public function getWebhookPayload(): array
    {
        return [
            'body' => [
                'status' => $this->status,
            ]
        ];
    }

$endpoint = WebhookRegistry::registerEndpoint(
  'https://webhook.site/custom/endpoint',
  'My webhook endpoint name'
);

$endpoint = WebhookRegistry::registerEndpoint(
  'https://localhost/webhook-test',
  'My insecure endpoint',
  false
);
bash
php artisan vendor:publish --provider="CustomD\WebhookRegistry\ServiceProvider" --tag="config"