PHPackages                             wasiliana/laravel-sdk - 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. wasiliana/laravel-sdk

ActiveLibrary[API Development](/categories/api)

wasiliana/laravel-sdk
=====================

This package is built to make it easier to interact with Wasiliana Api for Laravel developers.

v1.2.1(3y ago)010MITPHP

Since Jul 28Pushed 3y ago3 watchersCompare

[ Source](https://github.com/Wasiliana/laravel-sdk)[ Packagist](https://packagist.org/packages/wasiliana/laravel-sdk)[ Docs](https://github.com/wasiliana/laravel-sdk)[ RSS](/packages/wasiliana-laravel-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

 Wasiliana Laravel Sdk
-----------------------

[](#----wasiliana-laravel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1382ab9690905750668ab224047764b995e93ac4555342af6c1bf582831c5fc2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776173696c69616e612f6c61726176656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wasiliana/laravel-sdk)[![Total Downloads](https://camo.githubusercontent.com/04a5f6b3ac9303135dcd89171c147e4dbb3dc8472571f24a8bf32dbe538c6d25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776173696c69616e612f6c61726176656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wasiliana/laravel-sdk)[![Build Status](https://camo.githubusercontent.com/270b49a91418494922802cfc3f74ecc426172431675bb92d1f238c0637fe0281/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f776173696c69616e612f6c61726176656c2d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/wasiliana/laravel-sdk)[![StyleCI](https://camo.githubusercontent.com/cb13a877afd1dbe223c631789c3f922d3ace958fdb334a9cce9b26afefbc2ebd/68747470733a2f2f7374796c6563692e696f2f7265706f732f31323334353637382f736869656c64)](https://styleci.io/repos/12345678)

Introduction
------------

[](#introduction)

This package is built for Laravel developers to easen interaction with Wasiliana Rest Api.

😃 Installation
--------------

[](#smiley-installation)

```
composer require wasiliana/laravel-sdk
```

This command will install the latest version of the package.

⚙️ Configuration
----------------

[](#gear-configuration)

You can use `php artisan wasiliana:install` to copy the distribution configuration file to your app's config directory:

```
php artisan wasiliana:install
```

This will copy `wasiliana.php` settings file in your config directory.

Settings available in config file published.

```
return [
    'sms' => [
        'service_1' => [
            'name' => 'test',
            'from' => env('SMS_SERVICE_1_SENDER_ID', 'WASILIANA'),
            'key' => env('SMS_SERVICE_1_API_KEY', null)
        ],
    ],
    'airtime' => [
        'service_1' => [
            'name' => 'testAirtime',
            'key' => env('AIRTIME_SERVICE_1_API_KEY', null)
        ],
    ]
];
```

In a scenario where you have more than one service; the structure will appear as below.

```
return [
    'sms' => [
        'service_1' => [
            'name' => 'testSms',
            'from' => env('SERVICE_1_SENDER_ID', 'WASILIANA'),
            'key' => env('SERVICE_1_API_KEY', null)
        ],
        'service_2' => [
            'name' => 'testSms2',
            'from' => env('SERVICE_2_SENDER_ID', 'WASILIANA'),
            'key' => env('SERVICE_2_API_KEY', null)
        ]
    ],
    'airtime' => [
        'service_1' => [
            'name' => 'testAirtime',
            'key' => env('AIRTIME_SERVICE_1_API_KEY', null)
        ]
    ]
];
```

🔥 Usage
-------

[](#fire-usage)

### 1. Sms

[](#1-sms)

Import the Sms Facade at the top;

```
use Wasiliana\LaravelSdk\Facades\Sms;
```

#### Example 1: request

[](#example-1-request)

Using default service configured in wasiliana config file

```
$response = Sms::to(['2547XXXXXYYY', '2547XXXXXZZZ']) //use an array for multiple recipients
    ->message('This cold...Mayoooo!!!') // your message
    ->send(); // fire request

// OR

$response = Sms::send('2547XXXXXYYY', 'This cold...Mayoooo!!!'); //compose message, add recipients and send
```

#### Example 2: request

[](#example-2-request)

Using a different service configured in wasiliana config file

```
$response = Sms::to('2547XXXXXYYY')
    ->message('This a test dispatch.')
    ->service('service_2')
    ->send();

// OR

$response = Sms::service('service_2')->send(['2547XXXXXYYY', '2547XXXXXZZZ'], 'This a send test using a different service.'); // for multiple recipients use an array
```

#### Example 3: Request

[](#example-3-request)

Defing a custom message\_uid prefix

```
$response = Sms::to(['2547XXXXXYYY', '2547XXXXXZZZ'])
    ->message('This cold...Mayoooo!!!')
    ->prefix('notification') // custom message_uid prefix
    ->send();

// OR

$response = Sms::send('2547XXXXXYYY', 'This cold...Mayoooo!!!', 'notification');
```

#### Example 4: Response

[](#example-4-response)

After every request a response in array format is returned

```
// success response
// a confirmation from Wasiliana that the request has been received.
Array
(
    [status] => success
    [data] => Successfully Dispatched the sms to process
    [message_uid] => conversation_id_20220831154811
)

// error response
Array
(
    [status] => error
    [message] => Error in the data provided
    [data] => Array
        (
            [0] => The message field is required.
        )

)
```

The confirmation of whether the message was delivered successfully, to a number, or not is delivered to the callback configured in your account.

### 2. Airtime

[](#2-airtime)

Import the Sms Facade at the top;

```
use Wasiliana\LaravelSdk\Facades\Airtime;
```

#### Example 1: Request

[](#example-1-request-1)

Using default service configured in wasiliana config file

```
$response = Airtime::amount(10)->phone('0720XXXYYY')->send();
```

#### Example 2: Request

[](#example-2-request-1)

Send same amount of airtime to multiple numbers at once

```
$response = Airtime::amount(10)->->phone(['0723XXXYYY', '0711YYYXXX'])->send();
```

#### Example 3: Request

[](#example-3-request-1)

Using a different service configured in wasiliana config file

```
$response = Airtime::amount(10)->phone('0720XXXYYY')->service('service_2')->send();
```

#### Example 4: Response

[](#example-4-response-1)

Success and error responses retirned

```
// success response
Array
(
    [status] => success
    [message] => Ksh. 10 has been toped up sucessfuly
)

// error response
Array
(
    [status] => error
    [message] => Error in the data provided
    [data] => Array
        (
            [0] => The phone field is required.
        )

)

Array
(
    [status] => error
    [message] => You do not have sufficient airtime
    [data] =>
)
```

Environment variables
---------------------

[](#environment-variables)

You can update your `.env` to have the SENDER\_ID and API\_KEY values instead of having them in the config file;

```
SMS_SERVICE_1_SENDER_ID=
SMS_SERVICE_1_API_KEY=

AIRTIME_SERVICE_1_API_KEY=
```

**NOTE:** You don't have to define a SENDER\_ID in the `.env` when you are using the shared `WASILIANA` SENDER\_ID

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

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 ~18 days

Total

3

Last Release

1349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/105a31ce7d49d740450be7ee6a313416142beee69ed8e282e8072f641b97f29f?d=identicon)[le-yo](/maintainers/le-yo)

![](https://www.gravatar.com/avatar/22d2f02e66a717a41c2846ee042985dae000414b64c2c20d9ebc67845721d876?d=identicon)[lawrence615](/maintainers/lawrence615)

![](https://avatars.githubusercontent.com/u/60473403?v=4)[wasilianake](/maintainers/wasilianake)[@wasilianake](https://github.com/wasilianake)

---

Top Contributors

[![lawrence615](https://avatars.githubusercontent.com/u/3224157?v=4)](https://github.com/lawrence615 "lawrence615 (83 commits)")

---

Tags

laravelLaravelSdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wasiliana-laravel-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/wasiliana-laravel-sdk/health.svg)](https://phpackages.com/packages/wasiliana-laravel-sdk)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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