Skip to content

kimulisiraj/sms-speeda-mobile-php

Repository files navigation

Send SMS using speed mobile api

Latest Version on Packagist Tests Total Downloads

This is where your description should go. Try and limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require kimulisiraj/sms-speeda-mobile-php

Usage

Send single message

$client = new \Kimulisiraj\SmsSpeedaMobile\SmsSpeedaMobile(
    apiKey:"your-username",
    apiSecret: "your-password",
);

$response = $client->send(
    to: 2567xxxxxxxx,
    mesage:'Hello, Kimulisiraj!'
)
return $response; 

From the response you can access:

$response->getStatus(); // OK | FAILED
$response->getMessage(); // Message sent successfully
$response->hasError(); // true | false
$response->getMessageId(); // I.E 12345

Chaining

$client = Kimulisiraj\SmsSpeedaMobile::config([
    'apiKey' => 'your-api-key', //You can set and use env('SPEEDAMOBILE_SMS_API_ID')
    'apiPassword' => 'your-api-password', ////You can set and use env('SPEEDAMOBILE_SMS_API_PASSWORD')
]);

$response = $client->mesage('Hello, Kimulisiraj!')
        ->to('2567xxxxxxxx')
        ->send();

return $response 

Get balance

  $client = new \Kimulisiraj\SmsSpeedaMobile\SmsSpeedaMobile(
    apiKey:"your-username",
    apiSecret: "your-password",
);

$client->getBalance() // ['BalanceAmount' => 1000, 'CurrenceCode' => 'UGX'],

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.