PHPackages                             rezahmady/smsir - 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. rezahmady/smsir

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

rezahmady/smsir
===============

1.1.0(4y ago)43282[1 issues](https://github.com/rezahmady/smsir/issues)MITPHPPHP ~7.3|| ^8

Since Apr 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rezahmady/smsir)[ Packagist](https://packagist.org/packages/rezahmady/smsir)[ Docs](https://github.com/rezahmady/smsir)[ RSS](/packages/rezahmady-smsir/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Unofficial Laravel notification channel Package for sms.ir
==========================================================

[](#unofficial-laravel-notification-channel-package-for-smsir)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6491d2b919c349a8bed43f468799d2fbc4be1dfa7347733de0090248eaa62c7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657a61686d6164792f736d7369722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rezahmady/smsir)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0293e3b27eaa377bd38f25359535585c33878993d595cdd2cc55b17a3619b902/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72657a61686d6164792f736d7369722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rezahmady/smsir)[![SensioLabsInsight](https://camo.githubusercontent.com/7a395d7551140767a9f38f838e0e96b367bae56234402374185cd65ee8d795a1/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f3a73656e73696f5f6c6162735f69642e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/:sensio_labs_id)[![Quality Score](https://camo.githubusercontent.com/6be184d0bb7100417b769e1341976f7aa9efeee8d4491304eeb4d82897699e43/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72657a61686d6164792f736d7369722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rezahmady/smsir)[![Code Coverage](https://camo.githubusercontent.com/953ef4f8feba764e8a268924166d42c212b016ec3adcf628d67b4f098759271f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f72657a61686d6164792f736d7369722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rezahmady/smsir/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/425c4758bc23d0dfbe033ed6e4b7904b22407b3e2ea8a1ac26900efc37fef0c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72657a61686d6164792f736d7369722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rezahmady/smsir)

This package makes it easy to send notifications using [Smsir](https://sms.ir) with Laravel 5.5+, 6.x, 7.x , 8.x and 9.x

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the Smsir service](#setting-up-the-Smsir-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

```
composer require rezahmady/smsir

```

### Setting up the Smsir service

[](#setting-up-the-smsir-service)

First add these environment variables in your .env file:

```
SMSIR_API_KEY="xxxx"
SMSIR_SECRET_KEY="xxxx"
SMSIR_LINE_NUMBER="xxxx"

```

then add this method to your User model

```
public function routeNotificationForSmsir()
{
    return $this->mobile;
}

```

Usage
-----

[](#usage)

sample notification class:

```
namespace App\Notifications\Sms;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Rezahmady\Smsir\SmsirChannel;
use Rezahmady\Smsir\SmsirMessage;

class VerificationCode extends Notification
{
    use Queueable;

    public $parameter;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($parameter)
    {
        $this->parameter = $parameter;
    }

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

    public function toSmsir($notifiable)
    {
        return (new SmsirMessage())
                ->setMethod('ultraFastSend')
                ->setTemplateId('47119')
                ->setParameters([
                    'VerificationCode' => $this->parameter
                ]);

    }

}

```

sample trigger this notification :

```
return auth()->user()->notify(new VerificationCode('1234'));

```

### Available Message methods

[](#available-message-methods)

A list of all available options

**setMethod**

is require

```
->setMethod('METHOD_NAME')

```

smsir has two method for send sms :

**1. ultraFastSend**require attributes is `parameters` (array) and `templateId` (string) set them with this chain methods :

```
->setTemplateId('THEMPLATE_ID')
->setParameters([...]);

```

**2. sendVerificationCode**

require attributes is `code` (string) set it with this chane method :

```
->setCode('YOUR_CODE')

```

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Reza Ahmadi Sabzevar](https://github.com/rezahmady)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

**Note:**This package has been used to develop [amirbagh75/smsir-php](https://github.com/amirbagh75/smsir-php)Thanks to Amirhossein Baghaie

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~161 days

Total

3

Last Release

1516d ago

PHP version history (2 changes)1.0.0PHP ~7.3

1.0.1PHP ~7.3|| ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c0e003c10813b2c44186105522893dab84977d9cf3ce1dab37b81f6741c3d52?d=identicon)[rezahmady](/maintainers/rezahmady)

---

Top Contributors

[![rezahmady](https://avatars.githubusercontent.com/u/24762569?v=4)](https://github.com/rezahmady "rezahmady (5 commits)")[![hasanmonfared](https://avatars.githubusercontent.com/u/42858705?v=4)](https://github.com/hasanmonfared "hasanmonfared (1 commits)")

---

Tags

laravelsmsپیامکsendsmssmsirاس ام اسnotifacation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rezahmady-smsir/health.svg)

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

###  Alternatives

[ipecompany/smsirlaravel

Official Sms.ir Laravel Package

1810.2k1](/packages/ipecompany-smsirlaravel)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[tzsk/sms

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

320244.3k6](/packages/tzsk-sms)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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