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

ActiveLibrary[API Development](/categories/api)

saber13812002/sms
=================

Laravel SMS Gateway Integration Package

v5.4(4y ago)066[1 PRs](https://github.com/saber13812002/sms/pulls)MITPHPPHP ^7.4|^8.0

Since Dec 18Pushed 2y agoCompare

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

READMEChangelog (1)Dependencies (14)Versions (25)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)
- [Ghasedak](https://ghasedaksms.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 wan 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 you can 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 will have to make 2 methods.
    /**
    * 1. __constructor($settings) # {Mandatory} This settings is your Config Params that you've set.
    * 2. send() # (Mandatory) This is the main message that will be sent.
    *
    * Example Given below:
    */

    /**
    * @var array
    */
    protected $settings;

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

    /**
    * Your Driver Config.
    *
    * @var array $settings
    */
    public function __construct($settings)
    {
        $this->settings = $settings;
        # Initialize any Client that you want.
        $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

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 63.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 ~83 days

Recently: every ~62 days

Total

22

Last Release

1680d 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 (4 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

### Community

Maintainers

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

---

Top Contributors

[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (227 commits)")[![tzsk](https://avatars.githubusercontent.com/u/13273787?v=4)](https://github.com/tzsk "tzsk (76 commits)")[![khanzadimahdi](https://avatars.githubusercontent.com/u/6291970?v=4)](https://github.com/khanzadimahdi "khanzadimahdi (34 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)")[![saber13812002](https://avatars.githubusercontent.com/u/3294604?v=4)](https://github.com/saber13812002 "saber13812002 (4 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 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)")[![EmanueleCoppola](https://avatars.githubusercontent.com/u/12816305?v=4)](https://github.com/EmanueleCoppola "EmanueleCoppola (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![mohammadhsn](https://avatars.githubusercontent.com/u/30635428?v=4)](https://github.com/mohammadhsn "mohammadhsn (1 commits)")[![sae13](https://avatars.githubusercontent.com/u/17175994?v=4)](https://github.com/sae13 "sae13 (1 commits)")

---

Tags

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

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tzsk/sms

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

320244.3k6](/packages/tzsk-sms)[simplestats-io/laravel-client

Client for SimpleStats!

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

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

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