palpalani/laravel-bandwidth-api

This is my package LaravelBandwidthApi

0.2.0 2023-04-14 19:56 UTC

This package is auto-updated.

Last update: 2024-12-15 07:26:13 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Simple Laravel wrapper for BandWidth API SDK.

Installation

You can install the package via composer:

composer require palpalani/laravel-bandwidth-api

You can publish and run the migrations with:

php artisan vendor:publish --provider="palPalani\LaravelBandwidthApi\LaravelBandwidthApiServiceProvider" --tag="laravel-bandwidth-api-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="palPalani\LaravelBandwidthApi\LaravelBandwidthApiServiceProvider" --tag="laravel-bandwidth-api-config"

This is the contents of the published config file:

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'),
    ],
];

Usage

Sending basic SMS text message using Bandwidth API.

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

Accessing dashboard API:

$bandwidth = new palPalani\Bandwidth();
$account = $bandwidth->getAccount();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.