PHP code example of caydeesoft / whatsapp

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

    

caydeesoft / whatsapp example snippets


SocialMedia\WhatsApp\Events\WhatsAppWebhookReceived

use SocialMedia\WhatsApp\Events\WhatsAppWebhookReceived;

Event::listen(WhatsAppWebhookReceived::class, function (WhatsAppWebhookReceived $event) {
    // Handle $event->payload
});
bash
php artisan vendor:publish --tag=whatsapp-config
text
config/whatsapp.php
text
GET /api/whatsapp/webhook?hub.mode=subscribe&hub.verify_token=...&hub.challenge=...
text
POST /api/whatsapp/webhook