gashey/botman-ussd-driver

Botman USSD Driver for Laravel Projects

Downloads

17

Stars

1

Version

1.0.3

BotMan Mobiverse USSD Driver for Laravel

Latest Release on GitHub Software License Total Downloads

About

BotMan driver to connect the Mobiverse USSD API with BotMan

Installation

Install Botman for Laravel before installing this driver. See the Botman documentation.

Require the gashey/botman-ussd-driver package in your composer.json and update your dependencies:

$ composer require gashey/botman-ussd-driver

Add the Gashey\BotmanUssdDriver\UssdServiceProvider to your providers array:

Gashey\BotmanUssdDriver\UssdServiceProvider::class,

Add the following listener to your botman routes file:

$botman->hears(config('ussd.cancel_text', 'CANCEL'), function ($bot) {
    $bot->reply('stopped');
})->stopsConversation();

Usage

You can use the Mobiverse USSD Simulator to test your application. Supply your application url as: http://your-application.com/botman

Configuration

The defaults are set in config/botman/ussd.php. Publish the config using this command:

$ php artisan vendor:publish --provider="Gashey\BotmanUssdDriver\UssdServiceProvider"
return [

    "cancel_text" => "CANCEL",

    "network_mapping" => array('01' => 'MTN', '02' => 'VODAFONE', '03' => 'AIRTEL-TIGO', '04' => 'AIRTEL-TIGO', '05' => 'GLO'),
];

License

Released under the MIT License, see LICENSE.

gashey

Author

gashey