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

ActiveLibrary

elimuswift/sms
==============

An SMS wrapper for major sms gateways

v2.1.7(6y ago)0563[2 PRs](https://github.com/Elimuswift/sms/pulls)MITPHP

Since Jan 16Pushed 3y ago1 watchersCompare

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

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

Elimuswift SMS
==============

[](#elimuswift-sms)

[![Latest Stable Version](https://camo.githubusercontent.com/c9c213fb2199c8c49cde1a5a8314d77f2f95de67e52a206b5293f5b8cc0de7be/68747470733a2f2f706f7365722e707567782e6f72672f656c696d7573776966742f736d732f762f737461626c652e737667)](https://packagist.org/packages/elimuswift/sms)[![Latest Unstable Version](https://camo.githubusercontent.com/c837762b7f1bc6fd1fe5d08a00a5caf11267e5ee84d276d2b899141c5b8cba39/68747470733a2f2f706f7365722e707567782e6f72672f656c696d7573776966742f736d732f762f756e737461626c652e737667)](https://packagist.org/packages/elimuswift/sms)[![License](https://camo.githubusercontent.com/b99f8c9c632f8bdf2aed2c96eb290db7af9bca63ef81d5bedde840b96235333b/68747470733a2f2f706f7365722e707567782e6f72672f656c696d7573776966742f736d732f6c6963656e73652e737667)](https://packagist.org/packages/elimuswift/sms)[![Total Downloads](https://camo.githubusercontent.com/edc1750a28e70735c8806ae888539a7ef56c8d9ef02354ef5fcfcc53cc974acc/68747470733a2f2f706f7365722e707567782e6f72672f656c696d7573776966742f736d732f646f776e6c6f6164732e737667)](https://packagist.org/packages/elimuswift/sms)

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

[](#introduction)

Elimuswift SMS is a package for sending SMS using various SMS providers. This package for [Laravel](http://laravel.com/) adds the capability to send and receive SMS/MMS messages to mobile phones from your web app. The package supports [Africas Talking](https://www.africastalking.com/)

Requirements
------------

[](#requirements)

#### Laravel 5

[](#laravel-5)

- PHP: &gt;= 5.5
- Guzzle &gt;= 6.0

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

[](#configuration)

#### Composer

[](#composer)

First, add the Simple SMS package to your `require` in your `composer/json` file:

```
"require": {
    "elimuswift/sms": "~2.0"
}

```

Next, run the `composer update` command. This will install the package into your Laravel application.

#### Service Provider

[](#service-provider)

Once you have added the package to your composer file, you will need to register the service provider with Laravel.

```
	Elimuswift\SMS\Providers\SmsServiceProvider::class,
```

#### Aliases

[](#aliases)

Finally, register the Facade.

```
'SMS' => Elimuswift\SMS\Facades\SMS::class,
```

#### API Settings

[](#api-settings)

You must run the following command to save your configuration files to your local app:

```
 php artisan vendor:publish --provider="Elimuswift\SMS\Providers\SmsServiceProvider"

```

This will copy the configuration files to your `config` folder.

### Get Started

[](#get-started)

#### Africas Talkig

[](#africas-talkig)

To enable the AfricasTalking driver just change config file to:

```
'driver' => env('SMS_DRIVER', 'africastalking'),
'africastalking' => [
        'api_key' => env('AT_API_KEY', 'africastalking.api_key'),
        'username' => env('AT_USERNAME', 'africastalking.username'),
    ]
```

##### Nexmo Driver

[](#nexmo-driver)

This driver sends messages through the [Nexmo](https://www.nexmo.com/product/messaging/) messaging service. It is very reliable and capable of sending messages to mobile phones worldwide.

```
    return [
        'driver' => 'nexmo',
        'from' => 'Company Name',
        'nexmo' => [
            'api_key'       => 'Your Nexmo API Key',
            'api_secret'    => 'Your Nexmo API Secret',
            'encoding'      => 'unicode', // Can be `unicode` or `gsm`
        ]
    ];
```

#### Twilio Driver

[](#twilio-driver)

This driver sends messages through the [Twilio](https://www.twilio.com/sms) messaging service. It is very reliable and capable of sending messages to mobile phones worldwide.

```
    return [
        'driver' => 'twilio',
        'from' => '+15555555555', //Your Twilio Number in E.164 Format.
        'twilio' => [
            'account_sid' => 'Your SID',
            'auth_token' => 'Your Token',
            'verify' => true,  //Used to check if messages are really coming from Twilio.
        ]
    ];
```

#### Sending an SMS

[](#sending-an-sms)

With everything set up the right way sending an SMS notification would be as simple as:

```
use Elimuswift\SMS\Facades\SMS;

SMS::send('My first SMS message', [], function ($sms) {
	$sms->to('07xxxxxxxx');
});
```

#### Multiple Recipients

[](#multiple-recipients)

Sending to multiple Contacts

```
use Elimuswift\SMS\Facades\SMS;
$contacts = ['0711xxxxxx', '0722xxxxxx', '0701xxxxxx'];

SMS::send('My bulk SMS notification', [], function ($sms) use($contacts) {
	return array_map(function ($to) use($sms) {
		$sms->to($to);
	}, $contacts);
});
```

#### Send a Blade View

[](#send-a-blade-view)

You can also use a view to send the sms notification, The first parameter is the view file that you would like to use. The second is the data that you wish to pass to the view. The final parameter is a callback that will set all of the options on the message closure.

```
use App\Order;

$order = Order::with('user')->first();

SMS::send('sms.order-shiped', compact('order'), function($sms) use($order) {
    $sms->to($order->user->phone_number);
});
```

#### Driver

[](#driver)

The driver method will switch the provider during runtime.

```
//Will send through default provider set in the config file.
SMS::send('Your SMS Message', [], function($sms) {
    $sms->to('+15555555555');
});

SMS::driver('nexmo');

//Will send through Nexmo
SMS::send('Your SMS Message', [], function($sms) {
    $sms->to('+15555555555');
});
```

### Using Laravel Notifications

[](#using-laravel-notifications)

The package comes with a notification chanel for sending SMS messages using laravels notification system. To get stated add `routeNotificationForSMS()` method in your notifiable. this method should return the notifiables's phone number.

```
    /**
     * Get the notification identifier for SMS.
     *
     * @return string
     */
    public function routeNotificationForSMS()
    {
        return $this->attributes['phone_number'];
    }
```

#### Sending The Notification

[](#sending-the-notification)

Now you can use the channel in your `via()` method inside the notification:

```
use Elimuswift\SMS\Chennels\SMSChannel;
use Elimuswift\SMS\Notifications\SMSMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [SMSChannel::class];
    }

    public function toSms($notifiable)
    {
        return (new SMSMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}
```

You can also send a notification as a blade view.

```
public function toSms($notifiable)
{
    return (new SMSMessage('path.to.view'))
         ->viewData(['foo' => 'Bar', 'baaz' => 'blah']);
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% 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 ~85 days

Recently: every ~106 days

Total

12

Last Release

2465d ago

Major Versions

v1.0.1 → v2.0.02017-07-14

### Community

Maintainers

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

---

Top Contributors

[![weezqyd](https://avatars.githubusercontent.com/u/11520842?v=4)](https://github.com/weezqyd "weezqyd (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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