PHPackages                             bankola/laravel-multi-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. [HTTP &amp; Networking](/categories/http)
4. /
5. bankola/laravel-multi-sms

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bankola/laravel-multi-sms
=========================

A multi-provider SMS package for Laravel with failover support.

00PHP

Since Feb 24Pushed 4mo agoCompare

[ Source](https://github.com/techdeft/laravel-multi-sms)[ Packagist](https://packagist.org/packages/bankola/laravel-multi-sms)[ RSS](/packages/bankola-laravel-multi-sms/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Multi-Provider SMS Package
==================================

[](#laravel-multi-provider-sms-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2b758243c070f7beb6cf85ebc0196ae520ab582ef689571f04ebfff98a7e36b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616e6b6f6c612f6c61726176656c2d6d756c74692d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bankola/laravel-multi-sms)[![Total Downloads](https://camo.githubusercontent.com/96599bbf3899551315826fb5a87127ebb47ebd9ead22f2d6c1a0b5f5f5652e13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616e6b6f6c612f6c61726176656c2d6d756c74692d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bankola/laravel-multi-sms)[![License](https://camo.githubusercontent.com/a9bb561d9d429818d78d3706ded39cfe121c7ac1c238967c1432ac4d5e2054ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62616e6b6f6c612f6c61726176656c2d6d756c74692d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bankola/laravel-multi-sms)

A robust, extensible, driver-based SMS package for Laravel. Send SMS via multiple providers (Twilio, Vonage, etc.) with built-in failover support, queuing, and easy testing.

Features
--------

[](#features)

- **Multi-Driver Support**: Easily switch between providers (Twilio, Vonage, Log, etc.).
- **Failover Logic**: Automatically try fallback providers if the primary one fails.
- **Queue Support**: Seamless integration with Laravel Queues for background sending.
- **Event-Driven**: Dispatches events for sending, sent, and failed messages.
- **Testing Fakes**: Simple assertions for unit testing your SMS logic.
- **Extensible**: Add custom drivers with ease.

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

[](#installation)

You can install the package via composer:

```
composer require bankola/laravel-multi-sms
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag="sms-config"
```

This will create a `config/sms.php` file. You should configure your drivers and credentials in your `.env` file:

```
SMS_DRIVER=failover

TWILIO_SID=your_sid
TWILIO_TOKEN=your_token
TWILIO_FROM=your_phone_number

VONAGE_KEY=your_key
VONAGE_SECRET=your_secret
VONAGE_FROM=your_brand_name

SMS_LOG_CHANNEL=stack
```

Usage
-----

[](#usage)

### Sending an SMS

[](#sending-an-sms)

```
use Bankola\MultiSms\Facades\Sms;
use Bankola\MultiSms\DTO\SmsMessage;

Sms::send(new SmsMessage(
    to: '+1234567890',
    body: 'Your OTP is 1234'
));
```

### Using a Specific Driver

[](#using-a-specific-driver)

```
Sms::driver('twilio')->send($message);
```

### Queuing an SMS

[](#queuing-an-sms)

```
Sms::queue($message);

// Or specifying a driver for the queue
Sms::queue($message, 'vonage');
```

Drivers
-------

[](#drivers)

### Log Driver

[](#log-driver)

The `log` driver is perfect for local development. It writes the contents of the SMS to your Laravel logs.

### Twilio Driver

[](#twilio-driver)

Requires `twilio/sdk`. Configure `TWILIO_SID`, `TWILIO_TOKEN`, and `TWILIO_FROM` in your `.env`.

### Vonage Driver

[](#vonage-driver)

Requires `vonage/client`. Configure `VONAGE_KEY`, `VONAGE_SECRET`, and `VONAGE_FROM` in your `.env`.

### Failover Driver

[](#failover-driver)

The failover driver iterates through a list of drivers until one successfully sends the message.

```
'failover' => [
    'driver' => 'failover',
    'drivers' => ['twilio', 'vonage', 'log'],
],
```

Events
------

[](#events)

The package dispatches the following events:

- `Bankola\MultiSms\Events\SmsSending`: Before a message is sent.
- `Bankola\MultiSms\Events\SmsSent`: After a message is successfully sent.
- `Bankola\MultiSms\Events\SmsFailed`: When a message fails to send.

Testing
-------

[](#testing)

Use the `fake()` method to mock SMS sending in your tests:

```
use Bankola\MultiSms\Facades\Sms;

public function test_it_sends_an_sms()
{
    Sms::fake();

    // ... run your code ...

    Sms::assertSent(function ($message) {
        return $message->to === '+1234567890' && str_contains($message->body, 'OTP');
    });
}
```

Extending
---------

[](#extending)

You can register custom drivers using the `extend` method in your `AppServiceProvider`:

```
use Bankola\MultiSms\Facades\Sms;

Sms::extend('custom_provider', function ($app, $config) {
    return new CustomSmsDriver($config);
});
```

The custom driver must implement `Bankola\MultiSms\Contracts\SmsDriverInterface`.

License
-------

[](#license)

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

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/298c749f75bb8b8a8331a34378a09029e9dce3b36aac18fc6079f9aaf784d857?d=identicon)[techdeft](/maintainers/techdeft)

---

Top Contributors

[![techdeft](https://avatars.githubusercontent.com/u/53832918?v=4)](https://github.com/techdeft "techdeft (2 commits)")

### Embed Badge

![Health badge](/badges/bankola-laravel-multi-sms/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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