PHPackages                             variablesign/sms - 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. variablesign/sms

ActiveLibrary[API Development](/categories/api)

variablesign/sms
================

A Laravel SMS Gateway Integration package for bulk SMS providers in Ghana

v3.0.0(4mo ago)41022MITPHPPHP &gt;=7.2

Since Jun 8Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/variablesign/sms)[ Packagist](https://packagist.org/packages/variablesign/sms)[ Docs](https://github.com/variablesign/sms)[ RSS](/packages/variablesign-sms/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

Laravel SMS Sender
==================

[](#laravel-sms-sender)

[![Latest Version on Packagist](https://camo.githubusercontent.com/42405b91eed04a1d7975c74ecf1cbb2be362f9f4599d30f951aa48e6d5dc7592/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7661726961626c657369676e2f736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/variablesign/sms)[![Total Downloads](https://camo.githubusercontent.com/9011f1da89f5744430d7341c0d26a1ee7588a4fc6bf1169b6b6465848b4f031f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7661726961626c657369676e2f736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/variablesign/sms)[![GitHub License](https://camo.githubusercontent.com/a706bbe53cd8351142a85201cdcf511e102740d6bacb46f6741e18f6c85a9583/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7661726961626c657369676e2f736d73)](https://camo.githubusercontent.com/a706bbe53cd8351142a85201cdcf511e102740d6bacb46f6741e18f6c85a9583/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7661726961626c657369676e2f736d73)

A Laravel SMS Gateway Integration package for bulk SMS providers in **Ghana**. Below are the gateways that are currently supported and others added in future updates.

Available features:

- Check remaining SMS balance or credits
- Send SMS messages
- Check SMS delivery status
- Send OTP messages

Supported gateways:

- [SMS Online GH](https://smsonlinegh.com)
- [USMS-GH](https://usmsgh.com)
- [mNotify](https://mnotify.com)
- [Arkesel](https://arkesel.com)
- [TxtConnect](https://txtconnect.net)
- [PiloSMS](https://pilosms.com)
- More in future updates

GatewayBalanceSendReport[SMS Online GH](https://smsonlinegh.com)✓✓✓[USMS-GH](https://usmsgh.com)✓✓✓[mNotify](https://mnotify.com)✓✓✓[Arkesel](https://arkesel.com)✓✓✓[TxtConnect](https://txtconnect.net)✓✓✓[PiloSMS](https://pilosms.com)✓✓✗System Requirements
-------------------

[](#system-requirements)

- PHP 7.2 or greater
- Laravel 7 or greater

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

[](#installation)

You can install the package via composer:

```
composer require variablesign/sms
```

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

[](#configuration)

Publish the sms config by running this command after installation:

```
php artisan vendor:publish --provider="VariableSign\Sms\SmsServiceProvider" --tag="config"
```

Head to `config/sms.php` to start editing the configuration settings. Change the default gateway by setting the value to any of the gateways defined in the list of gateways. You can however ever switch between gateways in your code which will ignore the default config value.

```
'default' => 'smsonlinegh',
```

The following shows the options for `smsonlinegh` gateway.

```
'gatways' => [
    'smsonlinegh' => [
        'endpoints' => [
            'send' => 'https://api.smsonlinegh.com/v4/message/sms/send',
            'balance' => 'https://api.smsonlinegh.com/v4/report/balance',
            'report' => 'https://api.smsonlinegh.com/v4/report/message/delivery',
        ],
        'key' => 'Your API Key',
        'sender' => 'Your Sender ID',
        'verify' => false, // (optional) Disable SSL verification for non-https endpoints
        'timeout' => 15, // (optional) The connection timeout in seconds
    ],
    ...
]
```

Usage
-----

[](#usage)

### Checking SMS balance

[](#checking-sms-balance)

You can check your SMS balance or credits by using any of the following.

```
use VariableSign\Sms\Facades\Sms;

// Using the default gateway
$response = Sms::balance();

// With another gateway
$response = Sms::via('mnotify')->balance();
```

Without facades

```
use VariableSign\Sms\Sms;

$response = (new Sms)->via('mnotify')->balance();
```

With helper function

```
$response = sms()->via('mnotify')->balance();
```

Returns `int` or `float` as the response and `null` as default;

```
250
```

### Sending SMS messages

[](#sending-sms-messages)

You can send SMS messages by using any of the following.

```
use VariableSign\Sms\Facades\Sms;

// Using the default gateway
$response = Sms::to(['2332xxxxxxxx','2332xxxxxxxx'])
    ->message('Hi, we just want to thank you for using our service.')
    ->send();

// With another gateway
$response = Sms::via('arkesel')
    ->to(['2332xxxxxxxx','2332xxxxxxxx'])
    ->message('Hi, we just want to thank you for using our service.')
    ->send();
```

Without facades

```
use VariableSign\Sms\Sms;

$response = (new Sms)->via('arkesel')
    ->to(['2332xxxxxxxx','2332xxxxxxxx'])
    ->message('Hi, we just want to thank you for using our service.')
    ->send();
```

With helper function

```
$response = sms()->via('arkesel')
    ->to(['2332xxxxxxxx','2332xxxxxxxx'])
    ->message('Hi, we just want to thank you for using our service.')
    ->send();
```

Returns `\Illuminate\Support\Collection` as the response;

```
[
    {
        "id": "c61ff669-4bb1-41c1-97ea-11658dedafbd",
        "to": "2332xxxxxxxx",
        "message": "Hi, we just want to thank you for using our service.",
        "status": "submitted"
    },
    {
        "id": "572ae33d-3983-47a0-a1ac-6fc3efafac4f",
        "to": "2332xxxxxxxx",
        "message": "Hi, we just want to thank you for using our service.",
        "status": "submitted"
    }
]
```

### Checking SMS delivery status

[](#checking-sms-delivery-status)

You can check the delivery status of submitted messages by using their message `id`.

```
use VariableSign\Sms\Facades\Sms;

// Using the default gateway
$response = Sms::report('c61ff669-4bb1-41c1-97ea-11658dedafbd');

// With another gateway
$response = Sms::via('arkesel')->report('c61ff669-4bb1-41c1-97ea-11658dedafbd');
```

Without facades

```
use VariableSign\Sms\Sms;

$response = (new Sms)->via('arkesel')->report('c61ff669-4bb1-41c1-97ea-11658dedafbd');
```

With helper function

```
$response = sms()->via('arkesel')->report('c61ff669-4bb1-41c1-97ea-11658dedafbd');
```

Returns `\Illuminate\Support\Collection` as the response;

```
[
    {
        "id": "c61ff669-4bb1-41c1-97ea-11658dedafbd",
        "to": "2332xxxxxxxx",
        "status": "delivered"
    }
]
```

### Sending OTP messages

[](#sending-otp-messages)

You can use our `otp()` method to generate and quickly send one-time-pin messages.

```
use VariableSign\Sms\Facades\Sms;

// Can also be initialized without facades or with the helper function
$response = Sms::via('arkesel')
    ->to(['+2332xxxxxxxx'])
    ->otp('Password Reset', now()->addMinutes(5)->addSecond());
```

Returns `\Illuminate\Support\Collection` as the response;

```
[
    {
        "id": "4180e0a9-71cb-41e2-aafe-1cb69c1545ea",
        "to": "2332xxxxxxxx",
        "message": "Your Password Reset OTP is 9826. It expires in 5 minutes.",
        "status": "submitted",
        "otp": "9826",
        "expires_at": "2022-06-08T20:00:53.000000Z"
    }
]
```

Without expiration time

```
use VariableSign\Sms\Facades\Sms;

// Can also be initialized without facades or with the helper function
$response = Sms::via('arkesel')->to(['+2332xxxxxxxx'])->otp('Password Reset');
```

Returns `\Illuminate\Support\Collection` as the response;

```
[
    {
        "id": "d570a041-a13c-4e11-8e78-0c7515729556",
        "to": "2332xxxxxxxx",
        "message": "Your Password Reset OTP is 9826.",
        "status": "submitted",
        "otp": "9826"
    }
]
```

Or with your own custom messages. Use the `:code` placeholder in your messages and it will be replaced with the generated OTP. You can generate a code length between `4` to `8`. The example below generates a code length of `6`.

```
use VariableSign\Sms\Facades\Sms;

// Can also be initialized without facades or with the helper function
$response = Sms::via('arkesel')
    ->to(['+2332xxxxxxxx'])
    ->message('Your phone number verification code is :code.')
    ->otp(null, now()->addMinutes(5)->addSecond(), 6);
```

Returns `\Illuminate\Support\Collection` as the response;

```
[
    {
        "id": "e1ee89b2-05c7-454a-bf52-3ffe243aee1b",
        "to": "2332xxxxxxxx",
        "message": "Your phone number verification code is 803501. It expires in 5 minutes.",
        "status": "submitted",
        "otp": "803501",
        "expires_at": "2022-06-08T19:49:36.000000Z"
    }
]
```

Channel Usage
-------------

[](#channel-usage)

You can also send SMS messages through Laravel's notification class using `php artisan make:notification` command via `sms` or `SmsChannel::class` as the channel. If you want to change the `sms` channel name or disable it from being registered, you can do so in the config file.

```
namespace App\Notifications;

use Illuminate\Bus\Queueable;
use VariableSign\Sms\Channels\SmsChannel;
use Illuminate\Notifications\Notification;

class PaymentNotification extends Notification
{
    use Queueable;

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['sms']; // or SmsChannel::class
    }

    /**
     * Get the sms representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \VariableSign\Sms\Sms
     */
    public function toSms($notifiable)
    {
        return sms()
            ->via('smsonlinegh') // optional
            ->to($notifiable->phone)
            ->message('Your payment of 750.00 for order #10045 was successful.');
    }
}
```

Sending the notification:

```
$user->notify(new PaymentNotification);
```

### Notification channel response

[](#notification-channel-response)

You can learn how to retrieve the response through the `NotificationSent` event from the Notification section of the Laravel docs.

### Debugging

[](#debugging)

You can die dump the raw api response by adding the `dd()` method.

```
use VariableSign\Sms\Facades\Sms;

// Returns the unformatted response from the api endpoint
$response = Sms::dd()->via('usmsgh')->balance();
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Variable Sign](https://github.com/variablesign)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance74

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Recently: every ~196 days

Total

14

Last Release

144d ago

Major Versions

v0.1.3-alpha → v1.0.02022-06-08

v1.2.0 → v2.0.02023-11-02

v2.1.4 → v3.0.02025-12-25

PHP version history (2 changes)v0.1.0-alphaPHP ^7.4|^8.0

v1.1.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bd163dc8975ee93ce29d979640bfeac37ebe4bef2616b5ce2512794575e1599?d=identicon)[variablesign](/maintainers/variablesign)

---

Top Contributors

[![variablesign](https://avatars.githubusercontent.com/u/106929622?v=4)](https://github.com/variablesign "variablesign (48 commits)")

---

Tags

otpsmsmnotifysms online ghusms gharkesel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/variablesign-sms/health.svg)

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

###  Alternatives

[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

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