PHPackages                             tooma/laravel-sms-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tooma/laravel-sms-api

ActiveLibrary[API Development](/categories/api)

tooma/laravel-sms-api
=====================

Send and receive SMS anywhere in the world using our web services

v0.0.5(9y ago)020MITPHP

Since Jun 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ElijahGM/laravel-tooma)[ Packagist](https://packagist.org/packages/tooma/laravel-sms-api)[ Docs](http://www.tooma.co.ke)[ RSS](/packages/tooma-laravel-sms-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

Laravel-tooma
=============

[](#laravel-tooma)

Send and receive SMS anywhere in the world using Tooma web services

Integrate TOOMA SMS API with Laravel
====================================

[](#integrate-tooma-sms-api-with-laravel)

Laravel package to provide ntegration for TOOMA SMS service

Installation
------------

[](#installation)

Require this package with composer:

```
composer require tooma/laravel-sms-api

```

Once the package is added, add the ServiceProvider to the providers array in `config/app.php`:

```
Tooma\Laravel\Api\Providers\ToomaServiceProvider::class

```

Once done, publish the config to your config folder using:

```
php artisan vendor:publish --provider="Tooma\Laravel\Api\Providers\ToomaServiceProvider"

```

Configuration
-------------

[](#configuration)

Once the config file is published, open `config/tooma-api.php`

### Edit config

[](#edit-config)

Edit default configuration such as

`apiKey` : Your API key provider by Tooma

`defaultSSLPath` : Default path to ssl certificate if using a different certificate from default one

`defaultSenderName` : Default sender name defaults to TOOMA\_SMS (in Kenya)

Usage
-----

[](#usage)

### Retrive ApiKey

[](#retrive-apikey)

Once you get your API key, add it to the `config/tooma-api.php` config file, please note you only run this function once, you can also get your API key by going to tooma.co.ke &gt; settings &gt; api

```
app()->tooma->onSuccess(function($response,$pagination){
         // Logic when Login is successfull
         $apiKey = $response->data->token;

      })->onError(function($response)
      {
          // Logic on Error
      })->login(['username'=>'YOUR_USERNAME_OR_EMAIL','password'=>'YOUR_PASSWORD']);

```

### Sending Message

[](#sending-message)

Sending SMS is as easy as just

```
$parcel=[
      ['to'=>'+254XXXXXXXXX','message'=>'Greetings from Tooma'],
      ......
   ];
app()->tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull

      })->onError(function($response)
      {
          // Logic on Error
      })->sendSms($parcel);

```

### Sending Bulk Messages

[](#sending-bulk-messages)

Sending multiple message

```
$parcel=[
     ['to'=>'+254XXXXXXXXX','message'=>'Dear XXX Greetings from Tooma'],
     ['to'=>'+254YYYYYYYYY','message'=>'Dear YYY Greetings from Tooma'],
     ......
  ];
app()->tooma->onSuccess(function($response,$pagination){
        // Logic sending is successfull

     })->onError(function($response)
     {
         // Logic on Error
     })->sendSms($parcel);

```

### Retrive All Messages

[](#retrive-all-messages)

### Retrieve Message Status

[](#retrieve-message-status)

### Get account balancce

[](#get-account-balancce)

Getting balance just call balance as follows

```
app()->tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull
          echo "Your balance is $response->data->balance";

      })->onError(function($response)
      {
          // Logic on Error
      })->balance();

```

### Send Message from CSV files

[](#send-message-from-csv-files)

You can also send message from a csv file as follows

```
 $csvPath = "path/to/your/csv.csv";

 app()->tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull
          echo "Your balance is $response->data->balance";

      })->onError(function($response)
      {
          // Logic on Error
      })->withCsv($csvPath)
        ->withPhoneColumn('phone') //name of column with phone
        ->withTemplate('Dear :username_column_name your account balance is :balance_column_name')
        ->sendCsv();

```

### Working with Message templates

[](#working-with-message-templates)

You can also send message from a saved or new templat as follows

```
$data = [
  ['phone'=>'+254WWWWW','name'=>'','other_args'=>'args_val'];

];
app()->tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull
          echo "Your balance is $response->data->balance";

      })->onError(function($response)
      {
          // Logic on Error
      })->withParams(['args1'=>'val']) //extra parametaer
        ->withTemplate('Dear :name your account balance is :balance_column_name') //or you can pass a template id
        ->sendFromTemplate($data);

```

### Schedule Message

[](#schedule-message)

You can send SMS at a later stage by enableing schedule, the shedule format follows the cron format

```
$parcel=[
     ['to'=>'+254XXXXXXXXX','message'=>'Greetings from Tooma'],
     ......
  ];
app()->tooma->onSuccess(function($response,$pagination){
        // Logic sending is successfull
         echo "Your balance is $response->data->balance";

     })->onError(function($response)
     {
         // Logic on Error
     })->schedule("FORMART")
       ->sendSms($parcel);

```

Support
-------

[](#support)

Feel free to post your issues in the issues section.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

3302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c15a4181fc9ae5bef2ad3d22155544a07dd38c3c29e21da7cc134daf34d0c387?d=identicon)[Esofts](/maintainers/Esofts)

---

Top Contributors

[![ElijahGM](https://avatars.githubusercontent.com/u/918982?v=4)](https://github.com/ElijahGM "ElijahGM (3 commits)")

---

Tags

laravelsmssendtext messagereceivetooma

### Embed Badge

![Health badge](/badges/tooma-laravel-sms-api/health.svg)

```
[![Health](https://phpackages.com/badges/tooma-laravel-sms-api/health.svg)](https://phpackages.com/packages/tooma-laravel-sms-api)
```

###  Alternatives

[simplesoftwareio/simple-sms

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text messages. Currently supports CalLFire, EZTexting, Email Gateways, FlowRoute, LabsMobile, Mozeo, Nexmo, Plivo, Twilio, and Zenvia

20845.9k5](/packages/simplesoftwareio-simple-sms)[kavenegar/laravel

laravel 4 and 5 kavenegar integration

85342.4k5](/packages/kavenegar-laravel)[mrabbani/laravel_infobip

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text messages. Currently supports CallFire, EZTexting, Email Gateways, Mozeo, and Twilio.

114.1k](/packages/mrabbani-laravel-infobip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
