PHP code example of palpalani / laravel-bandwidth-api

1. Go to this page and download the library: Download palpalani/laravel-bandwidth-api 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/ */

    

palpalani / laravel-bandwidth-api example snippets


return [
    'messaging' => [
        'username' => env('BANDWIDTH_MESSAGING_USERNAME'),
        'password' => env('BANDWIDTH_MESSAGING_PASSWORD'),
    ],
    'voice' => [
        'username' => env('BANDWIDTH_VOICE_USERNAME'),
        'password' => env('BANDWIDTH_VOICE_PASSWORD'),
    ],
    'twoFactor' => [
        'username' => env('BANDWIDTH_TWO_FACTOR_USERNAME'),
        'password' => env('BANDWIDTH_TWO_FACTOR_PASSWORD'),
    ],
    'webRtc' => [
        'username' => env('BANDWIDTH_WEBRTC_USERNAME'),
        'password' => env('BANDWIDTH_WEBRTC_PASSWORD'),
    ],
];

$from = '';
$to = '';
$bandwidth = new palPalani\Bandwidth();
echo $bandwidth->sendMessage($from, $to, 'Hello, Greetings!');

$bandwidth = new palPalani\Bandwidth();
$account = $bandwidth->getAccount();
bash
php artisan vendor:publish --provider="palPalani\LaravelBandwidthApi\LaravelBandwidthApiServiceProvider" --tag="laravel-bandwidth-api-migrations"
php artisan migrate
bash
php artisan vendor:publish --provider="palPalani\LaravelBandwidthApi\LaravelBandwidthApiServiceProvider" --tag="laravel-bandwidth-api-config"