Skip to content

Getting Started

This section will help you get up and running with Nanasi Sms within your application in few minutes. You can start by following the steps below.

TIP

Don't worry, you can always test this out on a PHP script. Just make sure your have composer installed on your system and the right PHP version is in place.

Step. 1: Within your project directory.

If you already have an existing project and would like to start right away then run the following command:

composer require jasirilabs/nanasisms

Step. 2: Your first Nanasi Sms call.

Since we just want to see things working then lets see some code.

use JasiriLabs\NanasiSMS\Config;
use JasiriLabs\NanasiSMS\NextSms\NextSmsAdapter;
use JasiriLabs\NanasiSMS\NanasiSMS;

$config = new Config(['username' => 'jasirilabs', 'password' => 'no-bullshit']);

$sms = new NanasiSMS(
    new BeemSmsAdapter($config),
    []
);

$sms->send(['255757000000', '255654000000'], 'Hello Nanasi SMS');

When be above script is executed the two mobile numbers will receive greeting 😄 sms from your side.

Step. 3: You can do more!

Nanasi Sms is fine-tuned to help developer interact with SMS services under a convinient unified API to schedule, send, check relivery report and balance.

$sms->schedule('255757000000', 'Hello Scheduled SMS', ['date' => '2022-06-30', 'time' => '10:03']);
$sms->deliveryReport(['request_id' => '45785173']);
$sms->balance();

What's next?

By now you should be a able to make good use of the package. Time to explore more...

Released under the MIT License.