PHPackages                             zareshahi/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. zareshahi/sms

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

zareshahi/sms
=============

Laravel SMS Gateway Integration Package

5.4.4(4y ago)03MITPHPPHP ^7.4|8.\*

Since Dec 18Pushed 4y agoCompare

[ Source](https://github.com/ali-zareshai/sms)[ Packagist](https://packagist.org/packages/zareshahi/sms)[ Docs](https://github.com/tzsk/sms)[ Fund](https://paypal.me/KMAhmed)[ GitHub Sponsors](https://github.com/tzsk)[ RSS](/packages/zareshahi-sms/feed)WikiDiscussions master Synced today

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

🎁 Laravel SMS Gateway
=====================

[](#gift-laravel-sms-gateway)

[![SMS Cover](resources/sms.svg)](resources/sms.svg)

[![GitHub License](https://camo.githubusercontent.com/4427c7d234fa1e5d6b8725e4983fcb6657194b8f519bfea7284cd737f9692258/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747a736b2f736d733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/4427c7d234fa1e5d6b8725e4983fcb6657194b8f519bfea7284cd737f9692258/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747a736b2f736d733f7374796c653d666f722d7468652d6261646765)[![Latest Version on Packagist](https://camo.githubusercontent.com/12f007d8c19207c2e07e6ac000c0dc314e9626bd1df1ca53ddaeebe46d38f3e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747a736b2f736d732e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572)](https://packagist.org/packages/tzsk/sms)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d3290a495f3b9a715232cd49fc144149031c0078ad068d63aeba34fc0099cd62/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f747a736b2f736d732f54657374733f6c6162656c3d7465737473267374796c653d666f722d7468652d6261646765266c6f676f3d676974687562)](https://github.com/tzsk/sms/actions?query=workflow%3ATests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/632075d44b9a3de7552d88c0f7615763b1500f9f6b9a661e4b9a701ec4d0dc90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747a736b2f736d732e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c)](https://packagist.org/packages/tzsk/sms)

This is a Laravel Package for SMS Gateway Integration. Now Sending SMS is easy.

List of supported gateways:

- [AWS SNS](https://aws.amazon.com/sns/)
- [Textlocal](http://textlocal.in)
- [Twilio](https://www.twilio.com)
- [Clockwork](https://www.clockworksms.com/)
- [LINK Mobility](https://www.linkmobility.com)
- [Kavenegar](https://kavenegar.com)
- [Melipayamak](https://www.melipayamak.com)
- [Smsir](https://www.sms.ir)
- [Tsms](http://www.tsms.ir)
- [Farazsms](https://farazsms.com)
- [SMS Gateway Me](https://smsgateway.me)
- [SmsGateWay24](https://smsgateway24.com/en)
- [Ghasedak](https://ghasedaksms.com/)
- [Sms77](https://www.sms77.io)
- [SabaPayamak](https://sabapayamak.com)
- Others are under way.

📦 Install
---------

[](#package-install)

Via Composer

```
$ composer require tzsk/sms
```

⚡ Configure
-----------

[](#zap-configure)

Publish the config file

```
$ php artisan sms:publish
```

In the config file you can set the default driver to use for all your SMS. But you can also change the driver at runtime.

Choose what gateway you would like to use for your application. Then make that as default driver so that you don't have to specify that everywhere. But, you can also use multiple gateways in a project.

```
// Eg. if you want to use SNS.
'default' => 'sns',
```

Then fill the credentials for that gateway in the drivers array.

```
// Eg. for SNS.
'drivers' => [
    'sns' => [
        // Fill all the credentials here.
        'key' => 'Your AWS SNS Access Key',
        'secret' => 'Your AWS SNS Secret Key',
        'region' => 'Your AWS SNS Region',
        'sender' => 'Your AWS SNS Sender ID',
        'type' => 'Tansactional', // Or: 'Promotional'
    ],
    ...
]
```

#### Textlocal Configuration:

[](#textlocal-configuration)

Textlocal is added by default. You just have to change the creadentials in the `textlocal` driver section.

#### AWS SNS Configuration:

[](#aws-sns-configuration)

In case you want to use AWS SNS. Then you have to pull a composer library first.

```
composer require aws/aws-sdk-php
```

#### Clockwork Configuration:

[](#clockwork-configuration)

In case you want to use Clockwork. Then you have to pull a composer library first.

```
composer require mediaburst/clockworksms
```

#### Twilio Configuration:

[](#twilio-configuration)

In case you want to use Twilio. Then you have to pull a composer library first.

```
composer require twilio/sdk
```

Then you just have to change the creadentials in the `twilio` driver section.

#### Melipayamak Configuration:

[](#melipayamak-configuration)

In case you want to use Melipayamak. Then you have to pull a composer library first.

```
composer require melipayamak/php
```

#### Kavenegar Configuration:

[](#kavenegar-configuration)

In case you want to use Kavenegar. Then you have to pull a composer library first.

```
composer require kavenegar/php
```

#### SMS Gateway Me Configuration:

[](#sms-gateway-me-configuration)

In case you want to use SMS Gateway Me. Then you have to pull a composer library first.

```
composer require smsgatewayme/client
```

🔥 Usage
-------

[](#fire-usage)

In your code just use it like this.

```
# On the top of the file.
use Tzsk\Sms\Facades\Sms;

////

# In your Controller.
Sms::send("this message", function($sms) {
    $sms->to(['Number 1', 'Number 2']); # The numbers to send to.
});
# OR...
Sms::send("this message")->to(['Number 1', 'Number 2'])->dispatch();

# If you want to use a different driver.
Sms::via('gateway')->send("this message", function($sms) {
    $sms->to(['Number 1', 'Number 2']);
});
# OR...
Sms::via('gateway')->send("this message")->to(['Number 1', 'Number 2'])->dispatch();

# Here gateway is explicit : 'twilio' or 'textlocal' or any other driver in the config.
# The numbers can be a single string as well.

# If you are not a Laravel's facade fan, you can use sms helper:

sms()->send("this message", function($sms) {
    $sms->to(['Number 1', 'Number 2']); # The numbers to send to.
});

sms()->send("this message")->to(['Number 1', 'Number 2'])->dispatch();

sms()->via('gateway')->send("this message", function($sms) {
    $sms->to(['Number 1', 'Number 2']);
});

sms()->via('gateway')->send("this message")->to(['Number 1', 'Number 2'])->dispatch();
```

😍 Channel Usage
---------------

[](#heart_eyes-channel-usage)

First you have to create your notification using `php artisan make:notification` command. then `SmsChannel::class` can be used as channel like the below:

```
namespace App\Notifications;

use Tzsk\Sms\Builder;
use Illuminate\Bus\Queueable;
use Tzsk\Sms\Channels\SmsChannel;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;

class InvoicePaid extends Notification
{
    use Queueable;

    /**
     * Get the notification channels.
     *
     * @param  mixed  $notifiable
     * @return array|string
     */
    public function via($notifiable)
    {
        return [SmsChannel::class];
    }

    /**
     * Get the repicients and body of the notification.
     *
     * @param  mixed  $notifiable
     * @return Builder
     */
    public function toSms($notifiable)
    {
        return (new Builder)->via('gateway') # via() is Optional
            ->send('this message')
            ->to('some number');
    }
}
```

> **Tip:** You can use the same Builder Instance in the send method.

```
$builder = (new Builder)->via('gateway') # via() is Optional
    ->send('this message')
    ->to('some number');

Sms::send($builder);

# OR...
$builder = (new Builder)->send('this message')
    ->to(['some number']);

Sms::via('gateway')->send($builder);
```

#### Custom Made Driver, How To:

[](#custom-made-driver-how-to)

First you have to name your driver in the drivers array ,and also specify any config params you want.

```
'drivers' => [
    'textlocal' => [...],
    'twilio' => [...],
    'my_driver' => [
        ... # Your Config Params here.
    ]
]
```

Now you have to create a Driver Map Class that will be used to send the SMS. In your driver, You just have to extend `Tzsk\Sms\Contracts\Driver`.

Ex. You created a class : `App\Packages\SMSDriver\MyDriver`.

```
namespace App\Packages\SMSDriver;

use Tzsk\Sms\Contracts\Driver;

class MyDriver extends Driver
{
    /**
    * You Should implement these methods:
    *
    * 1. boot() -> (optional) Initialize any variable or configuration that you need.
    * 2. send() -> Main method to send messages.
    *
    * Note: settings array will be automatically assigned in Driver class' constructor.
    *
    * Example Given below:
    */

    /**
    * @var mixed
    */
    protected $client;

    protected function boot() : void
    {
        $this->client = new Client(); # Guzzle Client for example.
    }

    /**
    * @return object Ex.: (object) ['status' => true, 'data' => 'Client Response Data'];
    */
    public function send()
    {
        $this->recipients; # Array of Recipients.
        $this->body; # SMS Body.

        # Main logic of Sending SMS.
        ...
    }

}
```

Once you crate that class you have to specify it in the `sms.php` Config file `map` section.

```
'map' => [
    ...
    'my_driver' => App\Packages\SMSDriver\MyDriver::class,
]
```

**Note:-** You have to make sure that the key of the `map` array is identical to the key of the `drivers` array.

🔬 Testing
---------

[](#microscope-testing)

```
composer test
```

📅 Changelog
-----------

[](#date-changelog)

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

❤️ Contributing
---------------

[](#heart-contributing)

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

🔒 Security Vulnerabilities
--------------------------

[](#lock-security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

👑 Credits
---------

[](#crown-credits)

- [Kazi Ahmed](https://github.com/tzsk)
- [All Contributors](../../contributors)

👮‍♂️ License
------------

[](#policeman-license)

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

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 54.2% 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 ~75 days

Recently: every ~15 days

Total

26

Last Release

1589d ago

Major Versions

1.3.0 → 2.0.02019-01-24

2.0.2 → 3.0.02019-09-24

3.0.2 → 4.0.02020-03-04

4.0.1 → 5.0.02020-09-19

PHP version history (6 changes)1.0.0PHP ~5.6|~7.0

3.0.0PHP ^7.2

5.0.0PHP ^7.4

5.1.0PHP ^7.4|^8.0

5.4.2PHP ^7.4|^8.0|^9.0

5.4.4PHP ^7.4|8.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/33b1c3fa90ec64c69f9b3eb28b78701994e4c63e0dfb70afc438f89d8183a659?d=identicon)[ali\_zareshahi](/maintainers/ali_zareshahi)

---

Top Contributors

[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (228 commits)")[![tzsk](https://avatars.githubusercontent.com/u/13273787?v=4)](https://github.com/tzsk "tzsk (82 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (50 commits)")[![khanzadimahdi](https://avatars.githubusercontent.com/u/6291970?v=4)](https://github.com/khanzadimahdi "khanzadimahdi (34 commits)")[![omalizadeh](https://avatars.githubusercontent.com/u/12392549?v=4)](https://github.com/omalizadeh "omalizadeh (5 commits)")[![andvenaa](https://avatars.githubusercontent.com/u/13993996?v=4)](https://github.com/andvenaa "andvenaa (4 commits)")[![roshedgostarandev1](https://avatars.githubusercontent.com/u/52368299?v=4)](https://github.com/roshedgostarandev1 "roshedgostarandev1 (4 commits)")[![ali-zareshai](https://avatars.githubusercontent.com/u/22685427?v=4)](https://github.com/ali-zareshai "ali-zareshai (3 commits)")[![matthiez](https://avatars.githubusercontent.com/u/12965261?v=4)](https://github.com/matthiez "matthiez (2 commits)")[![dijonneto](https://avatars.githubusercontent.com/u/6545820?v=4)](https://github.com/dijonneto "dijonneto (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![EmanueleCoppola](https://avatars.githubusercontent.com/u/12816305?v=4)](https://github.com/EmanueleCoppola "EmanueleCoppola (1 commits)")[![cedroux](https://avatars.githubusercontent.com/u/2563986?v=4)](https://github.com/cedroux "cedroux (1 commits)")[![sae13](https://avatars.githubusercontent.com/u/17175994?v=4)](https://github.com/sae13 "sae13 (1 commits)")[![mohammadhsn](https://avatars.githubusercontent.com/u/30635428?v=4)](https://github.com/mohammadhsn "mohammadhsn (1 commits)")[![nikitospush](https://avatars.githubusercontent.com/u/8371008?v=4)](https://github.com/nikitospush "nikitospush (1 commits)")

---

Tags

smstzsklaravel sms gatewaylaravel textlocallaravel twiliolaravel link mobilitylaravel kavenegarlaravel melipayamaklaravel smsirlaravel tsmslaravel farazsmslaravel SMS gateway melaravel SmsGateWay24

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

319270.8k6](/packages/tzsk-sms)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

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

PHPackages © 2026

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