PHPackages                             kwtsms/laravel-kwtsms - 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. kwtsms/laravel-kwtsms

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

kwtsms/laravel-kwtsms
=====================

Laravel notification channel for the kwtSMS SMS gateway (Kuwait)

v1.0.12(1w ago)01↓100%MITPHPPHP ^8.1CI passing

Since Mar 12Pushed 5d agoCompare

[ Source](https://github.com/boxlinknet/kwtsms-laravel)[ Packagist](https://packagist.org/packages/kwtsms/laravel-kwtsms)[ Docs](https://www.kwtsms.com)[ RSS](/packages/kwtsms-laravel-kwtsms/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (6)Versions (11)Used By (0)

kwtSMS for Laravel
==================

[](#kwtsms-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0fbb8e253eb2126cf146c66b632f03894b6865378d3da8e0b17803c7ab6b36f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b7774736d732f6c61726176656c2d6b7774736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwtsms/laravel-kwtsms)[![Total Downloads](https://camo.githubusercontent.com/78d4aff037a06a7a8c0d08bf419e35f96e12c175b99fffe9200cd147bbbcb0b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b7774736d732f6c61726176656c2d6b7774736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwtsms/laravel-kwtsms)[![PHP Version](https://camo.githubusercontent.com/fce7323dae3f301555d45f2e85b38c1a22eb489c4db87002ea68e1e7df2751bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b7774736d732f6c61726176656c2d6b7774736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwtsms/laravel-kwtsms)[![Code Style](https://camo.githubusercontent.com/0719c9e44fe8f8af07951915632c1be7646476aa07e97cb99903284f2bacde4f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626f786c696e6b6e65742f6b7774736d732d6c61726176656c2f70696e742e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652b7374796c65267374796c653d666c61742d737175617265)](https://github.com/boxlinknet/kwtsms-laravel/actions/workflows/pint.yml)[![PHP](https://camo.githubusercontent.com/10d55801ece3df9555c68ed8e66de799c654964665dfa9a066c8fbbdd1a24972/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626f786c696e6b6e65742f6b7774736d732d6c61726176656c2f7068702e796d6c3f6272616e63683d6d61696e266c6162656c3d7068702b382e31254532253830253933382e33267374796c653d666c61742d737175617265)](https://github.com/boxlinknet/kwtsms-laravel/actions/workflows/php.yml)[![License](https://camo.githubusercontent.com/12a206bc8e86c0da35b9f9dbcafbbfd5e44c4468f6130e25a8da180de8a8d1ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626f786c696e6b6e65742f6b7774736d732d6c61726176656c3f7374796c653d666c61742d737175617265)](LICENSE)

A Laravel notification channel package for the [kwtSMS](https://www.kwtsms.com) SMS gateway (Kuwait). Send SMS messages through kwtSMS in any Laravel 10/11/12 application.

About kwtSMS
------------

[](#about-kwtsms)

[kwtSMS](https://www.kwtsms.com) is a Kuwait-based SMS gateway trusted by businesses to deliver messages across Kuwait (Zain, Ooredoo, STC, Virgin) and internationally. It offers private Sender IDs, free API testing, non-expiring credits, and competitive flat-rate pricing. Open a free account in under one minute at [kwtsms.com](https://www.kwtsms.com/signup/), no paperwork or payment required.

---

Features
--------

[](#features)

- Laravel Notification Channel integration (standard `$user->notify(...)` syntax)
- Admin panel at `/kwtsms`: Dashboard, Settings, Templates, Integrations, Logs, Admin Alerts, Help
- OTP and password reset SMS support with built-in rate limiting
- Multilingual SMS templates: English and Arabic (RTL ready) with `{{variable}}` placeholders
- Phone number normalization (strips `+`, `00`, spaces, dashes, Arabic/Hindi digits)
- Message cleaning (strips emojis, hidden characters, HTML before send)
- Bulk send with batching (max 200 numbers per request, 0.2s delay between batches)
- Pre-send balance check (cached, skips API call if zero balance)
- Coverage-aware sending (skips numbers from inactive country prefixes)
- Full SMS log in local database with export to CSV and clear/purge option
- Daily scheduled sync command for balance, sender IDs, and coverage
- Test mode support (`KWTSMS_TEST_MODE=true`: queued without delivery, credits recoverable)
- Global on/off kill switch (`KWTSMS_ENABLED=false`)
- Admin alert notifications (low balance, send failure, daily summary, API errors, OTP flood)

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

```
composer require kwtsms/laravel-kwtsms
```

Publish configuration and run migrations:

```
php artisan vendor:publish --tag=kwtsms-config
php artisan vendor:publish --tag=kwtsms-migrations
php artisan migrate
```

Optionally seed the default SMS templates (English + Arabic for all event types):

```
php artisan db:seed --class=KwtSMS\\Laravel\\Database\\Seeders\\KwtSmsDefaultTemplatesSeeder
```

Configuration
-------------

[](#configuration)

Add your kwtSMS API credentials to `.env`:

```
KWTSMS_USERNAME=your_api_username
KWTSMS_PASSWORD=your_api_password
KWTSMS_SENDER=YOUR-SENDERID
KWTSMS_TEST_MODE=false
KWTSMS_ENABLED=true
```

> **Note:** Use your API username and password from your kwtSMS account API settings page, not your mobile number.

> **Sender ID:** `KWT-SMS` is a shared test sender only. Register a private sender ID on your kwtSMS account before going live. Transactional sender IDs bypass DND lists and are required for OTP delivery.

Quick Start
-----------

[](#quick-start)

### Notification Channel

[](#notification-channel)

```
use KwtSMS\Laravel\Channels\KwtSmsChannel;
use KwtSMS\Laravel\Notifications\KwtSmsMessage;

class OrderShipped extends Notification
{
    public function via($notifiable): array
    {
        return [KwtSmsChannel::class];
    }

    public function toKwtSms($notifiable): KwtSmsMessage
    {
        return KwtSmsMessage::create()
            ->content("Your order has been shipped. Track: {$this->trackingCode}");
    }
}
```

Your notifiable model must implement `routeNotificationForKwtSms()`:

```
public function routeNotificationForKwtSms(): string
{
    return $this->phone; // e.g. "96598765432" (international format, digits only)
}
```

Then send as normal:

```
$user->notify(new OrderShipped($order));
```

### Direct Send via SmsSender

[](#direct-send-via-smssender)

```
use KwtSMS\Laravel\Services\SmsSender;

$sender = app(SmsSender::class);

// Single recipient
$result = $sender->send('96598765432', 'Hello from kwtSMS!');

// Multiple recipients (batched automatically)
$result = $sender->send(['96598765432', '96512345678'], 'Bulk message');

// With event type (used for template lookup and logging)
$result = $sender->send('96598765432', 'Your OTP is: 123456', null, [
    'event_type' => 'otp',
]);
```

Response format:

```
// Success
['success' => true, 'message_id' => 'abc123...', 'numbers_sent' => 1, 'points_charged' => 1, 'balance_after' => 150]

// Failure
['success' => false, 'reason' => 'ERR003', 'error_description' => 'Authentication error...']

// Blocked by guards
['success' => false, 'reason' => 'disabled']             // KWTSMS_ENABLED=false
['success' => false, 'reason' => 'rate_limited']         // per-IP or per-phone limit exceeded
['success' => false, 'reason' => 'no_balance']           // cached balance is zero
['success' => false, 'reason' => 'no_valid_recipients']  // empty list or all out of coverage
```

### Sending for Events (Template-Based)

[](#sending-for-events-template-based)

```
$sender->sendForEvent('order_placed', '96598765432', [
    'customer_name' => 'Ahmed',
    'order_id' => '#1234',
    'total' => '25.500',
]);
```

This looks up the active template with `event_type = 'order_placed'` and locale matching the user, substitutes `{{customer_name}}`, `{{order_id}}`, `{{total}}`, and sends.

### Facade

[](#facade)

```
use KwtSMS\Laravel\Facades\KwtSms;

KwtSms::send('96598765432', 'Hello!');
KwtSms::balance();
KwtSms::senderids();
```

SMS Templates
-------------

[](#sms-templates)

Templates are managed via the admin panel at `/kwtsms/templates`. Each template has:

- A name (e.g. `otp_en`)
- An event type (e.g. `otp`, `order_placed`, `password_reset`)
- A locale (`en` or `ar`)
- A message body with `{{variable_name}}` placeholders

Example template body:

```
Your OTP for {{app_name}} is: {{otp_code}}. Valid for {{expiry_minutes}} minutes. Do not share this code.

```

Rendered with:

```
$template->render([
    'app_name' => 'MyApp',
    'otp_code' => '123456',
    'expiry_minutes' => '5',
]);
// Output: Your OTP for MyApp is: 123456. Valid for 5 minutes. Do not share this code.
```

Default templates are seeded for: `otp`, `password_reset`, `order_placed`, `order_confirmed`, `order_shipped`, `order_delivered`, `order_cancelled`, `order_status`, `cod_otp`, `low_balance_alert`.

Admin Panel
-----------

[](#admin-panel)

After installation, visit `/kwtsms` to access the admin panel. It provides:

TabDescriptionDashboardBalance, send statistics, recent logsSettingsAPI credentials, test connection, low balance threshold, admin phoneTemplatesCreate, edit, activate/deactivate SMS templatesIntegrationsToggle which events trigger SMS sendsLogsView and export the full SMS send historyAdmin AlertsConfigure alert notifications to the admin phoneHelpQuick start guide and code examples> **Auth:** The admin panel uses the `admin_middleware` setting from `config/kwtsms.php`. Default is `['web', 'auth']`.

Artisan Commands
----------------

[](#artisan-commands)

```
# Sync balance, sender IDs, and coverage from the kwtSMS API
php artisan kwtsms:sync

# Force sync even if recently synced
php artisan kwtsms:sync --force
```

The sync command runs automatically every day at 03:00 (Asia/Kuwait) via the scheduler.

Phone Number Format
-------------------

[](#phone-number-format)

All phone numbers must be in international format, digits only, no prefix:

```
96598765432    correct
+96598765432   wrong (strip +)
0096598765432  wrong (strip 00)
965 9876 5432  wrong (strip spaces)

```

The package normalizes numbers automatically before every send. Numbers containing Arabic/Hindi digits are also converted.

Test Mode
---------

[](#test-mode)

When `KWTSMS_TEST_MODE=true`:

- Messages are queued on kwtSMS servers but not delivered to handsets
- Credits are not consumed (tentatively held until you delete from the queue)
- Test messages appear in your kwtSMS account Sending Queue
- Delete them from the queue at kwtsms.com to release any held credits

Always use test mode during development. Set `KWTSMS_TEST_MODE=false` only in production.

Help and Support
----------------

[](#help-and-support)

- **[kwtSMS FAQ](https://www.kwtsms.com/faq/)**: Answers to common questions about credits, sender IDs, OTP, and delivery
- **[kwtSMS Support](https://www.kwtsms.com/support.html)**: Open a support ticket or browse help articles
- **[Contact kwtSMS](https://www.kwtsms.com/#contact)**: Reach the kwtSMS team directly for Sender ID registration and account issues
- **[API Documentation (PDF)](https://www.kwtsms.com/doc/KwtSMS.com_API_Documentation_v41.pdf)**: kwtSMS REST API v4.1 full reference
- **[Best Practices](https://www.kwtsms.com/articles/sms-api-implementation-best-practices.html)**: SMS API implementation best practices
- **[Integration Test Checklist](https://www.kwtsms.com/articles/sms-api-integration-test-checklist.html)**: Pre-launch testing checklist
- **[Sender ID Help](https://www.kwtsms.com/sender-id-help.html)**: How to register, whitelist, and troubleshoot sender IDs
- **[kwtSMS Dashboard](https://www.kwtsms.com/login/)**: Recharge credits, buy Sender IDs, view message logs, manage coverage
- **[Other Integrations](https://www.kwtsms.com/integrations.html)**: Plugins and integrations for other platforms and languages

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE) for details.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Total

10

Last Release

7d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f35fd30b8e83a930879ee05a2bbfb0b093f5cfd36dd88db725df4eff4002d06?d=identicon)[kwtsms](/maintainers/kwtsms)

---

Top Contributors

[![boxlinknet](https://avatars.githubusercontent.com/u/130248345?v=4)](https://github.com/boxlinknet "boxlinknet (45 commits)")

---

Tags

kuwaitkuwait-smskuwaitsmskwtsmslaravelnotification-channelotpsmssms-apilaravelotpnotificationsmskuwaitkwtsms

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.4M9](/packages/laravel-notification-channels-twilio)[hooman-mirghasemi/laravel-iran-sms

Laravel Sms

241.8k](/packages/hooman-mirghasemi-laravel-iran-sms)

PHPackages © 2026

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