PHP code example of junandia / larawaba

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

    

junandia / larawaba example snippets


use Junandia\Larawaba\WhatsAppClient;

$wa = app(WhatsAppClient::class);
$wa->sendText('628123456789', 'Hello from Larawaba SDK!');

use Junandia\Larawaba\Events\MessageReceived;
use App\Listeners\ProcessWhatsAppMessage;
use Illuminate\Support\Facades\Event;

Event::listen(MessageReceived::class, ProcessWhatsAppMessage::class);

use Junandia\Larawaba\WhatsAppClient;

$wa = app(WhatsAppClient::class);
$wa->sendText('628123456789', 'Halo dari Larawaba SDK!');

use Junandia\Larawaba\Events\MessageReceived;
use App\Listeners\ProcessWhatsAppMessage;
use Illuminate\Support\Facades\Event;

Event::listen(MessageReceived::class, ProcessWhatsAppMessage::class);