PHPackages                             renderbit/laravel-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. [Testing &amp; Quality](/categories/testing)
4. /
5. renderbit/laravel-sms

ActiveLibrary[Testing &amp; Quality](/categories/testing)

renderbit/laravel-sms
=====================

Framework-agnostic PHP library for sending SMS via Renderbit, with Laravel support.

1.3.0(5mo ago)0843MITPHPPHP ^8.1CI passing

Since Jun 5Pushed 1w agoCompare

[ Source](https://github.com/RenderbitTechnologies/laravel-sms)[ Packagist](https://packagist.org/packages/renderbit/laravel-sms)[ Docs](https://github.com/renderbit/laravel-sms)[ RSS](/packages/renderbit-laravel-sms/feed)WikiDiscussions master Synced today

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

Laravel SMS
===========

[](#laravel-sms)

[![Tests](https://github.com/RenderbitTechnologies/laravel-sms/actions/workflows/tests.yml/badge.svg)](https://github.com/RenderbitTechnologies/laravel-sms/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/bca0be425899aa15f1a6d1c214eaa58878974be3751f259ccaddd164a4e50ae4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656e6465726269742f6c61726176656c2d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renderbit/laravel-sms)[![PHP Version](https://camo.githubusercontent.com/5f6df2071599d43401e5ba8d6013a031ce941df5761e7e0ed902bc8411873a6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f72656e6465726269742f6c61726176656c2d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renderbit/laravel-sms)[![Laravel Version](https://camo.githubusercontent.com/e5c2fb6451395d8077b6eef94d1bebc0a2e1bc6ab1e8f5b5f1568ce1ad12a1d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d626c75653f7374796c653d666c61742d737175617265)](https://laravel.com)[![License](https://camo.githubusercontent.com/f81e39e98b729333d0493104904a5e153ed1e79235666bc187fc5febc49458e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72656e6465726269742f6c61726176656c2d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renderbit/laravel-sms)

A Laravel package to send transactional SMS messages through supported SMS gateways. Built with simplicity and robustness in mind.

🚀 Features
----------

[](#-features)

- Simple API to send SMS via Facade or dependency injection
- API-based architecture — works with any SMS gateway
- Template variable substitution (`{{ name }}` placeholders)
- Configurable query parameters, number field, and message field
- Disable SMS in non-production environments via config
- Laravel-native configuration, logging, and service provider
- PHP 8.1+ with Guzzle HTTP client

📦 Installation
--------------

[](#-installation)

```
composer require renderbit/laravel-sms
```

Laravel auto-discovers the service provider. No manual registration needed.

🛠 Configuration
---------------

[](#-configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Renderbit\Sms\SmsServiceProvider" --tag=config
```

This will publish `config/sms.php`. Example contents:

```
return [
    'enabled' => env('SMS_ENABLED', false),
    'url' => env('SMS_API_URL', 'http://182.18.143.11/api/mt/SendSMS?'),
    'query_params' => [
        'user' => env('SMS_USER'),
        'password' => env('SMS_PASSWORD'),
        'senderid' => env('SMS_SENDER_ID', 'IEMUEM'),
        'channel' => 'trans',
        'DCS' => 0,
        'flashsms' => 0,
        'route' => '1',
    ],
    'number_field' => env('SMS_NUMBER_FIELD', 'number'),
    'message_field' => env('SMS_MESSAGE_FIELD', 'text'),
];
```

Update your `.env` file:

```
SMS_ENABLED=true
SMS_USER=
SMS_PASSWORD=
SMS_SENDER_ID='IEMUEM'
SMS_API_URL='http://182.18.143.11/api/mt/SendSMS?'
SMS_NUMBER_FIELD='number'
SMS_MESSAGE_FIELD='text'
```

> **Note:** SMS sending is disabled by default. Set `SMS_ENABLED=true` in your `.env` or `sms.enabled` in config to enable it.

✉️ Usage
--------

[](#️-usage)

Send an SMS using the Facade or `SmsClient`:

### Using Facade

[](#using-facade)

```
use Sms;

Sms::send('+919999999999', 'Hello, your OTP is 123456');
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use Renderbit\Sms\SmsClient;

class NotificationService
{
    public function __construct(protected SmsClient $sms) {}

    public function notify(string $phone, string $message): bool
    {
        return $this->sms->send($phone, $message);
    }
}
```

### Template Variables

[](#template-variables)

You can pass replacement values in a third parameter:

```
Sms::send('+919999999999', 'Hello {{ name }}, your code is {{ code }}', [
    'name' => 'John',
    'code' => 'ABC123',
]);
// Sends: "Hello John, your code is ABC123"
```

✅ Return Value
--------------

[](#-return-value)

The `send` method returns `true` on success (or when SMS is disabled) and `false` on failure:

```
if (! Sms::send($phone, $message)) {
    // Log failure or retry
}
```

Errors are logged automatically via Laravel's logger.

🧪 Testing
---------

[](#-testing)

Run the package's test suite:

```
vendor/bin/phpunit
```

The suite covers unit tests (SmsClient, SmsServiceProvider, Facade) and feature tests (integration through the Laravel container), **22 tests** with **51 assertions**.

To control SMS behavior in your own tests:

```
// Disable SMS in tests (sending is logged, not actually sent)
config(['sms.enabled' => false]);
```

📁 Project Structure
-------------------

[](#-project-structure)

```
config/
  sms.php              — Default configuration published to the app
src/
  SmsClient.php         — Core SMS sending logic with template substitution
  SmsServiceProvider.php — Laravel service provider (singleton binding, config publish)
  Facades/
    Sms.php              — Facade accessor for SmsClient
tests/
  Unit/
    SmsClientTest.php         — 13 tests covering send(), edge cases, and config
    SmsServiceProviderTest.php — Tests for singleton binding, boot, and config publishing
    SmsFacadeTest.php          — Tests for facade resolution and call forwarding
  Feature/
    SmsIntegrationTest.php    — 3 tests for end-to-end flows through the container

```

🤝 Contributing
--------------

[](#-contributing)

Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

43

↑

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.4% 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 ~108 days

Total

3

Last Release

177d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16665819?v=4)[Renderbit Technologies](/maintainers/renderbit-technologies)[@renderbit-technologies](https://github.com/renderbit-technologies)

---

Top Contributors

[![soham2008xyz](https://avatars.githubusercontent.com/u/7334295?v=4)](https://github.com/soham2008xyz "soham2008xyz (25 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![AdityaVJ](https://avatars.githubusercontent.com/u/21195870?v=4)](https://github.com/AdityaVJ "AdityaVJ (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

github-actionsguzzlehttplaravel-10laravel-11laravel-12laravel-packagepackagistphpphp81php82php83php84phpunitsmsapilaravelsmstextmessagingrenderbit

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10240.6k](/packages/gr8shivam-laravel-sms-api)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.1k38](/packages/dreamfactory-df-core)

PHPackages © 2026

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