PHP code example of dexalt142 / sendtalk

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

    

dexalt142 / sendtalk example snippets




namespace App\Http\Controllers;

use Dexalt142\SendTalk\Facades\SendTalk;

class MessageController {

    public function getMessage() {
        // SendTalk::getMessageStatus($id)
        $message = SendTalk::getMessageStatus('f26ccf7a-d867-b3a4-d333-117ec668718d');
    }

}



namespace App\Http\Controllers;

use Dexalt142\SendTalk\Facades\SendTalk;

class MessageController {

    public function sendMessage() {

        // SendTalk::sendTextMessage($phoneNumber, $content)
        $textMessage = SendTalk::sendTextMessage('+6281234567890', 'Foo Bar');

        // SendTalk::sendImageMessage($phoneNumber, $imageUrl, $fileName, $caption = null)
        $imageMessage = SendTalk::sendImageMessage('+6281234567890', 'https://example.com/foobar.png', 'foobar.png', 'Foo Bar');

        // SendTalk::sendOTPMessage($phoneNumber, $content)
        $otpMessage = SendTalk::sendOTPMessage('+6281234567890', 'Foo Bar');
    }

}