PHPackages                             vantomdev/smsmisr - 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. vantomdev/smsmisr

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

vantomdev/smsmisr
=================

OTP and SMS API integration for SmsMisr

1.2.2(1y ago)0551↓48.3%MITPHPPHP &gt;=8.1

Since Feb 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ahmednaserdev/vantomdev-laravel-smsmisr)[ Packagist](https://packagist.org/packages/vantomdev/smsmisr)[ RSS](/packages/vantomdev-smsmisr/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Laravel SmsMisr 🚀
=================

[](#laravel-smsmisr-)

A powerful Laravel package for integrating **SmsMisr** OTP and SMS APIs. This package supports multiple Laravel versions up to **12.x**, allowing easy and efficient management of SMS and OTP functionalities.

[![Build Status](https://camo.githubusercontent.com/73bf09feebd1a32bcc360cedb29512256b5d0eb101a7ef8c4e9c1f1f00f186b0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61686d65646e617365726465762f76616e746f6d6465762d6c61726176656c2d736d736d6973722f746573742e796d6c3f6272616e63683d6d61696e)](https://camo.githubusercontent.com/73bf09feebd1a32bcc360cedb29512256b5d0eb101a7ef8c4e9c1f1f00f186b0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61686d65646e617365726465762f76616e746f6d6465762d6c61726176656c2d736d736d6973722f746573742e796d6c3f6272616e63683d6d61696e)[![Coverage](https://camo.githubusercontent.com/2c8907e4ec44de065be2d2f4a5f34e2bdfc0275687ce21956c0f04e92918ebd8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f61686d65646e617365726465762f76616e746f6d6465762d6c61726176656c2d736d736d697372)](https://camo.githubusercontent.com/2c8907e4ec44de065be2d2f4a5f34e2bdfc0275687ce21956c0f04e92918ebd8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f61686d65646e617365726465762f76616e746f6d6465762d6c61726176656c2d736d736d697372)[![Packagist Version](https://camo.githubusercontent.com/4d246a17586362ae0e5e6f2f19c624c156c34044f1ebe4a63a1660937e0fb274/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616e746f6d6465762f736d736d697372)](https://camo.githubusercontent.com/4d246a17586362ae0e5e6f2f19c624c156c34044f1ebe4a63a1660937e0fb274/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616e746f6d6465762f736d736d697372)[![License](https://camo.githubusercontent.com/6a7cbeb687aeb6405273e241bbb85c2a939f78e218fae7fd2efe7f4774d4c869/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76616e746f6d6465762f736d736d697372)](https://camo.githubusercontent.com/6a7cbeb687aeb6405273e241bbb85c2a939f78e218fae7fd2efe7f4774d4c869/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76616e746f6d6465762f736d736d697372)

---

🌟 Features
----------

[](#-features)

- 🔑 **Send OTPs** to single mobile numbers using predefined templates.
- 📲 **Send SMS** to single or multiple mobile numbers.
- 🌐 **Multiple languages** support (English, Arabic, Unicode).
- 🔒 **Rate Limiting** to prevent abuse and reduce costs (Max 3 messages per minute, block for 5 minutes).
- 📘 **Detailed Localization Support** for multilingual websites.
- 🔄 **Flexible configuration** for Live and Testing environments.
- 🔧 **Customizable API URLs** for OTP and SMS requests.
- 💎 **Seamless integration** with Laravel 8.x to 12.x.

---

⚙️ Requirements
---------------

[](#️-requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 8.x
- GuzzleHttp &gt;= 7.5

---

🚀 Installation
--------------

[](#-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require vantomdev/smsmisr
```

### Step 2: Publish the Configuration

[](#step-2-publish-the-configuration)

```
php artisan vendor:publish --tag=config --provider="VantomDev\SmsMisr\SmsMisrServiceProvider"
```

### Step 3: Publish Language Files

[](#step-3-publish-language-files)

```
php artisan vendor:publish --tag=lang --provider="VantomDev\SmsMisr\SmsMisrServiceProvider"
```

### Step 4: Add Environment Variables

[](#step-4-add-environment-variables)

Add the following variables to your `.env` file:

```
SMSMISR_USERNAME=your_username
SMSMISR_PASSWORD=your_password
SMSMISR_SENDER=your_sender
SMSMISR_ENV=2  # 1 for Live, 2 for Test

# API Base URLs
SMSMISR_BASE_URL_OTP=https://smsmisr.com/api/OTP/
SMSMISR_BASE_URL_SMS=https://smsmisr.com/api/SMS/

# Default Template Token
SMSMISR_TEMPLATE_TOKEN=your_default_template_token

# Rate Limiting (Optional)
SMSMISR_RATE_LIMIT=true
SMSMISR_MAX_REQUESTS=3
SMSMISR_BLOCK_DURATION=5
```

---

⏰ Rate Limiting
---------------

[](#-rate-limiting)

To prevent abuse and excessive costs, this package has built-in rate limiting.

- Maximum of **3 messages per minute** per mobile number.
- If exceeded, the user is **blocked for 5 minutes**.
- Error message displayed using localization:

```
'Too many requests. Please try again after 5 minutes.'
```

You can customize this message in your language files or disable rate limiting by setting:

```
'enable_rate_limit' => false,
```

in `config/smsmisr.php`.

---

🌐 Localization Support
----------------------

[](#-localization-support)

This package supports multiple languages for error messages and notifications. Default languages included:

- English (`resources/lang/vendor/smsmisr/en/messages.php`)
- Arabic (`resources/lang/vendor/smsmisr/ar/messages.php`)

You can add more languages by creating new files under `resources/lang/vendor/smsmisr/{lang_code}/messages.php`.

Example:

```
return [
    'rate_limited' => 'Too many requests. Please try again after 5 minutes.',
    'success' => 'OTP sent successfully!',
];
```

---

🔥 Usage Examples
----------------

[](#-usage-examples)

### 1. Send OTP

[](#1-send-otp)

```
use VantomDev\SmsMisr\Facades\SmsMisr;
use VantomDev\SmsMisr\Exceptions\SmsMisrException;

try {
    $response = SmsMisr::sendOtp('2011XXXXXXX', '123456');
    return back()->with('success', __('smsmisr::messages.success'));
} catch (SmsMisrException $e) {
    return back()->with('error', $e->getMessage());
}
```

### 2. Send SMS

[](#2-send-sms)

```
use VantomDev\SmsMisr\Facades\SmsMisr;
use VantomDev\SmsMisr\Exceptions\SmsMisrException;

try {
    $response = SmsMisr::sendSms('2011XXXXXXX', 'This is a test message.', 1); # 1 For English , 2 For Arabic , 3 For Unicode
    return back()->with('success', __('smsmisr::messages.success'));
} catch (SmsMisrException $e) {
    return back()->with('error', $e->getMessage());
}
```

---

🎨 Changelog
-----------

[](#-changelog)

### v1.2.0

[](#v120)

- **Added Configurable API URLs**: `base_url_otp` and `base_url_sms` are now customizable.
- **Refactored ServiceProvider**: Improved Dependency Injection for better testability.
- **Improved Rate Limiting**: Now configurable from `config/smsmisr.php` or `.env`.

### v1.1.0

[](#v110)

- **Added Rate Limiting**: Max 3 messages per minute, block for 5 minutes.
- **Enhanced Localization Support**: Multi-language support for error messages.
- **Refactored ServiceProvider**: Improved Dependency Injection and Interface Binding.
- **Custom Exceptions and Logging**: Enhanced error handling and logging mechanism.

### v1.0.0

[](#v100)

- Initial release with OTP and SMS support.

---

🧑‍💻 Contributing
----------------

[](#‍-contributing)

1. Fork the repository.
2. Create a new branch (`feature/your-feature-name`).
3. Make your changes and commit them (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature/your-feature-name`).
5. Open a pull request.

---

📧 Support
---------

[](#-support)

For any issues, please create an issue on the [GitHub Repository](https://github.com/ahmednaserdev/vantomdev-laravel-smsmisr/issues).

---

❤️ Contributors
---------------

[](#️-contributors)

Thanks to all contributors for helping make this package better!

---

⚖️ License
----------

[](#️-license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

🚀 Happy Coding!
---------------

[](#-happy-coding)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance44

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

438d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25f909000d59f19804320ab59d505a176801493e8b7f883160e02d27c33bf4d1?d=identicon)[ahmednaserdev](/maintainers/ahmednaserdev)

---

Top Contributors

[![ahmednaserdev](https://avatars.githubusercontent.com/u/196178141?v=4)](https://github.com/ahmednaserdev "ahmednaserdev (16 commits)")

### Embed Badge

![Health badge](/badges/vantomdev-smsmisr/health.svg)

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

###  Alternatives

[illuminate/http

The Illuminate Http package.

11936.0M5.1k](/packages/illuminate-http)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[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)
