PHPackages                             ongudidan/textsms - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ongudidan/textsms

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ongudidan/textsms
=================

A universal, framework-agnostic PHP package for sending bulk SMS via TextSMS API. Compatible with Laravel, Yii2, Symfony, and Vanilla PHP. Features include single/bulk messaging, balance checking, and delivery status tracking.

v1.0.2(4mo ago)036PHP

Since Mar 9Pushed 4mo ago1 watchersCompare

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

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

📩 TextSMS - Universal Bulk SMS Package for PHP
==============================================

[](#-textsms---universal-bulk-sms-package-for-php)

A lightweight, framework-agnostic PHP package for sending bulk SMS via TextSMS API. Compatible with **Laravel**, **Yii2**, **Symfony**, and **Vanilla PHP**.

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

[](#-features)

- 📨 Send Single or Bulk SMS
- 💰 Check Account Balance
- 📊 Check Delivery Status
- 🔌 Stateles and Scalable Design

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

[](#-installation)

Install the package via Composer:

```
composer require ongudidan/textsms
```

⚙️ Usage
--------

[](#️-usage)

Since version 2.1, this package is designed to be stateless. You pass your API credentials directly to the methods. This allows for better scalability and handling multiple configurations if needed.

### 1️⃣ Vanilla PHP Example

[](#1️⃣-vanilla-php-example)

```
require 'vendor/autoload.php';

use TextSms\Sms;

$partnerID = '1234';
$apiKey = 'your_api_key';
$shortcode = 'SMS';

// Send an SMS
$response = Sms::send($partnerID, $apiKey, $shortcode, '254712345678', 'Hello from PHP!');
print_r($response);
```

### 2️⃣ Laravel Integration

[](#2️⃣-laravel-integration)

It is recommended to wrap the library in a Service or Helper to avoid repeating credentials.

**Step 1: Add credentials to `.env`**

```
TEXTSMS_PARTNER_ID=1234
TEXTSMS_API_KEY=your_api_key
TEXTSMS_SHORTCODE=SMS
```

**Step 2: Create a Service Class (e.g., `App\Services\SmsService.php`)**

```
namespace App\Services;

use TextSms\Sms;

class SmsService
{
    protected $partnerID;
    protected $apiKey;
    protected $shortcode;

    public function __construct()
    {
        $this->partnerID = config('services.textsms.partner_id');
        $this->apiKey = config('services.textsms.api_key');
        $this->shortcode = config('services.textsms.shortcode');
    }

    public function send($mobile, $message)
    {
        return Sms::send($this->partnerID, $this->apiKey, $this->shortcode, $mobile, $message);
    }
}
```

**Step 3: Use in Controllers**

```
use App\Services\SmsService;

public function checkout(SmsService $sms)
{
    $sms->send('254712345678', 'Order Received!');
}
```

### 3️⃣ Yii2 Integration

[](#3️⃣-yii2-integration)

You can create a helper component.

```
namespace common\components;

use Yii;
use yii\base\Component;
use TextSms\Sms;

class SmsComponent extends Component
{
    public $partnerID;
    public $apiKey;
    public $shortcode;

    public function send($mobile, $message)
    {
        return Sms::send($this->partnerID, $this->apiKey, $this->shortcode, $mobile, $message);
    }
}
```

**Configuration in `config/web.php`:**

```
'components' => [
    'sms' => [
        'class' => 'common\components\SmsComponent',
        'partnerID' => '...',
        'apiKey' => '...',
        'shortcode' => '...',
    ],
],
```

**Usage:**

```
Yii::$app->sms->send('254123456789', 'Hello from Yii!');
```

🛠 Available Methods
-------------------

[](#-available-methods)

### Send SMS

[](#send-sms)

```
Sms::send($partnerID, $apiKey, $shortcode, $mobile, $message);
```

### Check Balance

[](#check-balance)

```
Sms::balance($partnerID, $apiKey);
```

### Check Message Status

[](#check-message-status)

```
Sms::status($partnerID, $apiKey, $messageId);
```

🔄 Response Format
-----------------

[](#-response-format)

The API returns a JSON array:

```
{
  "responses": [
    {
      "response-code": 200,
      "response-description": "Success",
      "mobile": "254712345678",
      "messageid": "1869610817",
      "networkid": 1
    }
  ]
}
```

📜 License
---------

[](#-license)

This package is licensed under the MIT License.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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 ~149 days

Total

3

Last Release

136d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43ad5b4ed785d15200922c40f836a6b8661e274cf57ad50c53a8cb1552beb86f?d=identicon)[ongudidan](/maintainers/ongudidan)

---

Top Contributors

[![ongudidan](https://avatars.githubusercontent.com/u/153520866?v=4)](https://github.com/ongudidan "ongudidan (11 commits)")

### Embed Badge

![Health badge](/badges/ongudidan-textsms/health.svg)

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

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[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)
