PHP code example of ayodvr / laravel-webhook-manager

1. Go to this page and download the library: Download ayodvr/laravel-webhook-manager 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/ */

    

ayodvr / laravel-webhook-manager example snippets




namespace App\Listeners;

use Cybrox\WebhookManager\Events\WebhookReceived;

class ProcessWebhook
{
    public function handle(WebhookReceived $event): void
    {
        $webhookEvent = $event->webhookEvent;

        // Process based on provider
        if ($webhookEvent->provider === 'paystack') {
            $payload = json_decode($webhookEvent->payload, true);
            // Your logic here...
        }
    }
}

return [
    'route_prefix' => env('WEBHOOK_ROUTE_PREFIX', 'webhooks'),
    'signature_secret' => env('WEBHOOK_SIGNATURE_SECRET'),
    'max_attempts' => env('WEBHOOK_MAX_ATTEMPTS', 3),
    'queue' => env('WEBHOOK_QUEUE', 'webhooks'),
    'providers' => ['stripe', 'paypal', 'github', 'paystack'],
];
bash
php artisan vendor:publish --tag=webhook-config
bash
php artisan migrate
bash
   php artisan serve
   
bash
php artisan test