PHPackages                             expertsystemsau/transmitsms-laravel-client - 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. expertsystemsau/transmitsms-laravel-client

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

expertsystemsau/transmitsms-laravel-client
==========================================

Laravel notification channel and integration for the TransmitSMS API

v1.6.0(3mo ago)023↓50%MITPHPPHP ^8.2

Since Dec 9Pushed 3mo agoCompare

[ Source](https://github.com/expertsystemsau/transmitsms-laravel-client)[ Packagist](https://packagist.org/packages/expertsystemsau/transmitsms-laravel-client)[ Docs](https://github.com/expertsystemsau/transmitsms-laravel-client)[ RSS](/packages/expertsystemsau-transmitsms-laravel-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (5)Used By (0)

TransmitSMS Laravel Integration
===============================

[](#transmitsms-laravel-integration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d3fcfe8040dc1b615ab649e88a51dd5f5d71cabf0f85e4ebc6a55085dbe55e11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65787065727473797374656d7361752f7472616e736d6974736d732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/expertsystemsau/transmitsms-laravel)[![Total Downloads](https://camo.githubusercontent.com/028261aa26145fd644e78914b75a090bdf3a8b0351f7beb2b6900015e9d63c91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65787065727473797374656d7361752f7472616e736d6974736d732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/expertsystemsau/transmitsms-laravel)[![License](https://camo.githubusercontent.com/d488c1612fadb90a0216de44833df4a5c27ed87bdb4bf5054b4daf3393c7a139/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65787065727473797374656d7361752f7472616e736d6974736d732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/expertsystemsau/transmitsms-laravel)

Laravel notification channel and integration for the [TransmitSMS API](https://transmitsms.com/).

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

[](#installation)

```
composer require expertsystemsau/transmitsms-laravel
```

Publish the configuration file:

```
php artisan vendor:publish --tag="transmitsms-config"
```

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

[](#configuration)

Add your credentials to your `.env` file:

```
TRANSMITSMS_API_KEY=your-api-key
TRANSMITSMS_API_SECRET=your-api-secret
TRANSMITSMS_FROM=YourSenderID
```

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use ExpertSystems\TransmitSms\Laravel\Facades\TransmitSms;

// Send an SMS
TransmitSms::sendSms('+61400000000', 'Hello from Laravel!');

// Get account balance
$balance = TransmitSms::getBalance();
```

### Notifications

[](#notifications)

Create a notification that uses the TransmitSMS channel:

```
use Illuminate\Notifications\Notification;
use ExpertSystems\TransmitSms\Laravel\Notifications\TransmitSmsMessage;

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

    public function toTransmitSms($notifiable): TransmitSmsMessage
    {
        return TransmitSmsMessage::create('Your order has been shipped!')
            ->from('MyStore');
    }
}
```

Add the `routeNotificationForTransmitsms` method to your notifiable model:

```
class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForTransmitsms($notification): ?string
    {
        return $this->phone_number;
    }
}
```

Then send notifications:

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

DLR &amp; Reply Callbacks
-------------------------

[](#dlr--reply-callbacks)

The package provides automatic handling for DLR (Delivery Receipt), Reply, and Link Hit callbacks. When you send an SMS, you can specify a job to be dispatched when a callback is received.

### Quick Start

[](#quick-start)

```
use App\Jobs\UpdateOrderSmsStatusJob;
use App\Jobs\ProcessCustomerReplyJob;
use ExpertSystems\TransmitSms\Laravel\Notifications\TransmitSmsMessage;

class OrderShipped extends Notification
{
    public function __construct(public Order $order) {}

    public function via($notifiable): array
    {
        return ['transmitsms'];
    }

    public function toTransmitSms($notifiable): TransmitSmsMessage
    {
        return TransmitSmsMessage::create("Your order #{$this->order->id} has shipped!")
            ->from('MYSTORE')
            ->onDlr(UpdateOrderSmsStatusJob::class, [
                'order_id' => $this->order->id,
            ])
            ->onReply(ProcessCustomerReplyJob::class, [
                'order_id' => $this->order->id,
                'customer_id' => $notifiable->id,
            ]);
    }
}
```

### Creating Handler Jobs

[](#creating-handler-jobs)

**DLR Handler Job:**

```
namespace App\Jobs;

use App\Models\Order;
use ExpertSystems\TransmitSms\Data\DlrCallbackData;
use ExpertSystems\TransmitSms\Laravel\Contracts\HandlesDlrCallback;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class UpdateOrderSmsStatusJob implements HandlesDlrCallback, ShouldQueue
{
    use InteractsWithQueue, Queueable;

    public function __construct(
        public DlrCallbackData $dlr,
        public array $context,
    ) {}

    public function handle(): void
    {
        $order = Order::find($this->context['order_id']);

        $order->update([
            'sms_status' => $this->dlr->status,
            'sms_delivered_at' => $this->dlr->isDelivered()
                ? now()->parse($this->dlr->datetime)
                : null,
        ]);

        if ($this->dlr->isFailed()) {
            // Handle failure - maybe send email instead
            Log::warning('SMS delivery failed', [
                'order_id' => $order->id,
                'error' => $this->dlr->errorDescription,
            ]);
        }
    }
}
```

**Reply Handler Job:**

```
namespace App\Jobs;

use App\Models\SmsConversation;
use ExpertSystems\TransmitSms\Data\ReplyCallbackData;
use ExpertSystems\TransmitSms\Laravel\Contracts\HandlesReplyCallback;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;

class ProcessCustomerReplyJob implements HandlesReplyCallback, ShouldQueue
{
    use Queueable;

    public function __construct(
        public ReplyCallbackData $reply,
        public array $context,
    ) {}

    public function handle(): void
    {
        SmsConversation::create([
            'order_id' => $this->context['order_id'],
            'customer_id' => $this->context['customer_id'],
            'direction' => 'inbound',
            'message' => $this->reply->message,
            'mobile' => $this->reply->mobile,
            'received_at' => $this->reply->receivedAt,
        ]);
    }
}
```

**Link Hit Handler Job:**

```
namespace App\Jobs;

use ExpertSystems\TransmitSms\Data\LinkHitCallbackData;
use ExpertSystems\TransmitSms\Laravel\Contracts\HandlesLinkHitCallback;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;

class TrackLinkClickJob implements HandlesLinkHitCallback, ShouldQueue
{
    use Queueable;

    public function __construct(
        public LinkHitCallbackData $linkHit,
        public array $context,
    ) {}

    public function handle(): void
    {
        LinkClick::create([
            'campaign_id' => $this->context['campaign_id'],
            'mobile' => $this->linkHit->mobile,
            'url' => $this->linkHit->url,
            'clicked_at' => $this->linkHit->clickedAt,
        ]);
    }
}
```

### Global Event Listeners

[](#global-event-listeners)

In addition to per-message handlers, you can listen to events for all callbacks:

```
// App\Providers\EventServiceProvider.php
use ExpertSystems\TransmitSms\Laravel\Events\DlrReceived;
use ExpertSystems\TransmitSms\Laravel\Events\ReplyReceived;
use ExpertSystems\TransmitSms\Laravel\Events\LinkHitReceived;

protected $listen = [
    DlrReceived::class => [
        \App\Listeners\LogDlrCallback::class,
    ],
    ReplyReceived::class => [
        \App\Listeners\LogReplyCallback::class,
    ],
    LinkHitReceived::class => [
        \App\Listeners\LogLinkHitCallback::class,
    ],
];
```

Example listener:

```
namespace App\Listeners;

use ExpertSystems\TransmitSms\Laravel\Events\DlrReceived;
use Illuminate\Support\Facades\Log;

class LogDlrCallback
{
    public function handle(DlrReceived $event): void
    {
        Log::info('DLR callback received', [
            'message_id' => $event->dlr->messageId,
            'mobile' => $event->dlr->mobile,
            'status' => $event->dlr->status,
            'context' => $event->context,
        ]);
    }
}
```

### Webhook Configuration

[](#webhook-configuration)

The webhook routes are automatically registered. You can customize them in `config/transmitsms.php`:

```
'webhooks' => [
    // Enable/disable webhook routes
    'enabled' => env('TRANSMITSMS_WEBHOOKS_ENABLED', true),

    // Route prefix (e.g., /webhooks/transmitsms/dlr)
    'prefix' => env('TRANSMITSMS_WEBHOOKS_PREFIX', 'webhooks/transmitsms'),

    // Middleware for webhook routes
    'middleware' => ['api'],

    // Custom signing key (defaults to APP_KEY)
    'signing_key' => env('TRANSMITSMS_SIGNING_KEY'),

    // DLR callback settings
    'dlr' => [
        'enabled' => true,
        'path' => 'dlr',
        'queue' => env('TRANSMITSMS_DLR_QUEUE', 'default'),
    ],

    // Reply callback settings
    'reply' => [
        'enabled' => true,
        'path' => 'reply',
        'queue' => env('TRANSMITSMS_REPLY_QUEUE', 'default'),
    ],

    // Link hits callback settings
    'link_hits' => [
        'enabled' => true,
        'path' => 'link-hits',
        'queue' => env('TRANSMITSMS_LINK_HITS_QUEUE', 'default'),
    ],
],
```

### Callback Data Objects

[](#callback-data-objects)

**DlrCallbackData** properties:

PropertyTypeDescription`messageId``int`The message ID`mobile``string`Recipient phone number`status``string`Status: `delivered`, `failed`, `pending``datetime``?string`Delivery timestamp`senderId``?string`Sender ID used`errorCode``?string`Error code if failed`errorDescription``?string`Error descriptionHelper methods: `isDelivered()`, `isFailed()`, `isPending()`

**ReplyCallbackData** properties:

PropertyTypeDescription`messageId``int`Original message ID`mobile``string`Sender phone number`message``string`Reply message text`receivedAt``string`Timestamp when received`responseId``?int`Reply ID`longcode``?string`Number replied to`firstName``?string`Sender first name`lastName``?string`Sender last name**LinkHitCallbackData** properties:

PropertyTypeDescription`messageId``int`Message ID`mobile``string`Recipient phone number`url``string`URL that was clicked`clickedAt``string`Click timestamp`userAgent``?string`Browser user agent`ipAddress``?string`IP address### How It Works

[](#how-it-works)

1. **Sending**: When you use `onDlr()`, `onReply()`, or `onLinkHit()`, the package builds a signed callback URL containing your handler class and context data.
2. **Receiving**: When TransmitSMS calls the webhook, the package:

    - Verifies the HMAC signature
    - Parses the callback data into a DTO
    - Dispatches a global event (for logging/monitoring)
    - Dispatches your handler job with the data and context
3. **Security**: The callback URL includes an HMAC signature to prevent tampering. Only callbacks with valid signatures are processed.

```
┌─────────────────────────────────────────────────────────────────────┐
│  Your App                                                           │
│  ────────                                                           │
│  TransmitSmsMessage::create('Hello')                               │
│      ->onDlr(MyJob::class, ['id' => 1])                           │
│                    │                                                │
│                    ▼                                                │
│  Package builds signed callback URL                                │
│  https://app.com/webhooks/transmitsms/dlr?h=...&c=...&s=...       │
└─────────────────────────────────────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────────────────┐
│  TransmitSMS                                                        │
│  ───────────                                                        │
│  Sends SMS → Receives DLR → Calls your webhook URL                 │
└─────────────────────────────────────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────────────────┐
│  Your App (Webhook)                                                 │
│  ─────────────────                                                  │
│  WebhookController:                                                │
│    1. Verify signature ✓                                           │
│    2. Parse DlrCallbackData                                        │
│    3. Dispatch DlrReceived event                                   │
│    4. Dispatch MyJob with data + context                           │
└─────────────────────────────────────────────────────────────────────┘

```

License
-------

[](#license)

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

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance78

Regular maintenance activity

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~12 days

Total

4

Last Release

116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fab0568c54eee5c67c710ea427f0957a9032aa0b69167dde3f1bd423dde3ce14?d=identicon)[xsys](/maintainers/xsys)

---

Top Contributors

[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (12 commits)")[![mitchello77](https://avatars.githubusercontent.com/u/9065203?v=4)](https://github.com/mitchello77 "mitchello77 (3 commits)")[![pbelos](https://avatars.githubusercontent.com/u/50578419?v=4)](https://github.com/pbelos "pbelos (1 commits)")

---

Tags

laravelsmsnotification-channeltransmitsmsExpertSystems

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/expertsystemsau-transmitsms-laravel-client/health.svg)

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[s-ichikawa/laravel-sendgrid-driver

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

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/discord

Laravel notification driver for Discord.

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

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

320244.3k6](/packages/tzsk-sms)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

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