PHP code example of asanak / laravel-web-call-client

1. Go to this page and download the library: Download asanak/laravel-web-call-client 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/ */

    

asanak / laravel-web-call-client example snippets


use Asanak\WebCall\Facade\AsanakWebCallFacade as AsanakWebCall;

try {
    $data = AsanakWebCall::uploadNewVoice('/path/file/voice.mp3');
    dd($data);
} catch (\Throwable $e) {
    echo $e->getMessage();
}

use Asanak\WebCall\Facade\AsanakWebCallFacade as AsanakWebCall;

try {
    $data = AsanakWebCall::callByVoice('VOICE_FILE_ID', '09120000000');
    dd($data);
} catch (\Throwable $e) {
    echo $e->getMessage();
}

use Asanak\WebCall\Facade\AsanakWebCallFacade as AsanakWebCall;

try {
    $data = AsanakWebCall::callByOtp(1234, '09120000000');
    dd($data);
} catch (\Throwable $e) {
    echo $e->getMessage();
}

use Asanak\WebCall\Facade\AsanakWebCallFacade as AsanakWebCall;

try {
    $data = AsanakWebCall::callStatus(['CALL_ID_1', 'CALL_ID_2']);
} catch (\Throwable $e) {
    echo $e->getMessage();
}

use Asanak\WebCall\Facade\AsanakWebCallFacade as AsanakWebCall;

try {
    $data = AsanakWebCall::getCredit();
    dd($data['credit']);
} catch (\Throwable $e) {
    echo $e->getMessage();
}
bash
php artisan vendor:publish --tag=asanak-config