PHPackages                             track-any-device/sms-gateway - 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. track-any-device/sms-gateway

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

track-any-device/sms-gateway
============================

SMS gateway HTTP client for the Track Any Device platform.

1.0.4(2w ago)0192↓100%MITPHPPHP ^8.3CI passing

Since May 23Pushed 6d agoCompare

[ Source](https://github.com/track-any-device/package-sms-gateway)[ Packagist](https://packagist.org/packages/track-any-device/sms-gateway)[ RSS](/packages/track-any-device-sms-gateway/feed)WikiDiscussions main Synced 1w ago

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

track-any-device/sms-gateway
============================

[](#track-any-devicesms-gateway)

Laravel HTTP client package for the [Track Any Device](https://trackanydevice.com) SMS gateway device. Wraps the gateway REST API with a typed service class, automatic config merging, and a contract interface for easy mocking in tests.

---

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

[](#requirements)

- PHP 8.3+
- Laravel 11, 12, or 13

---

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

[](#installation)

```
composer require track-any-device/sms-gateway
```

The service provider is auto-discovered. No manual registration needed.

---

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

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=sms-gateway-config
```

This creates `config/sms.php`. Add the corresponding values to your `.env`:

```
SMS_GATEWAY_URL=http://192.168.1.100:8080
SMS_GATEWAY_API_KEY=your-api-key
SMS_GATEWAY_TIMEOUT=15
```

KeyDescriptionDefault`SMS_GATEWAY_URL`Base URL of the gateway device—`SMS_GATEWAY_API_KEY`API key sent as `X-API-Key`—`SMS_GATEWAY_TIMEOUT`HTTP timeout in seconds`15`---

Usage
-----

[](#usage)

Inject `SmsGatewayContract` (or `SmsGatewayService`) wherever you need it:

```
use TrackAnyDevice\SmsGateway\Contracts\SmsGatewayContract;

class NotificationController extends Controller
{
    public function __construct(private SmsGatewayContract $sms) {}

    public function notify(string $phone): void
    {
        $this->sms->send($phone, 'Your order has been dispatched.');
    }
}
```

### Send an SMS

[](#send-an-sms)

```
$sent = $sms->send('+447700900000', 'Hello from TAD!');

if (! $sent) {
    // false is returned on HTTP error, gateway error, or network exception
    // details are logged via Log::error
}
```

### Check gateway health

[](#check-gateway-health)

```
if ($sms->health()) {
    // gateway is reachable and reports status: ok
}
```

### Read the inbox

[](#read-the-inbox)

```
$messages = $sms->inbox();

// Each message:
// [
//     'index'   => '1',
//     'sender'  => '+447700900000',
//     'message' => 'Reply text',
//     'date'    => '2024/06/01 14:30:00+0100',
// ]

foreach ($messages as $msg) {
    $received = $sms->parseGatewayDate($msg['date']); // CarbonImmutable|null
    echo $msg['sender'].': '.$msg['message'];
}
```

### Delete a message

[](#delete-a-message)

```
$deleted = $sms->deleteMessage($msg['index']);
```

### Device status

[](#device-status)

```
$status = $sms->status();

// Returns array or null:
// [
//     'signal'   => '-73 dBm',
//     'network'  => '4G',
//     'operator' => 'EE',
//     'sim'      => 'ready',
// ]
```

---

Testing
-------

[](#testing)

Bind a mock against the contract in your test:

```
use TrackAnyDevice\SmsGateway\Contracts\SmsGatewayContract;

$this->mock(SmsGatewayContract::class)
    ->shouldReceive('send')
    ->once()
    ->with('+447700900000', 'Hello from TAD!')
    ->andReturn(true);
```

---

Logging
-------

[](#logging)

All failures are logged through Laravel's default logger:

EventLevel`send` HTTP error or gateway error`error``send` network exception`error``inbox` HTTP error`error``inbox` network exception`error``parseGatewayDate` bad format`warning`---

Licence
-------

[](#licence)

MIT

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance98

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.9% 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 ~1 days

Total

5

Last Release

15d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83275f3144d4cc4092e54dd8d5acf6a048536f6d7e454d741ae82a61f904c737?d=identicon)[ahmadkokab](/maintainers/ahmadkokab)

---

Top Contributors

[![afaryab](https://avatars.githubusercontent.com/u/68786248?v=4)](https://github.com/afaryab "afaryab (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")

### Embed Badge

![Health badge](/badges/track-any-device-sms-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/track-any-device-sms-gateway/health.svg)](https://phpackages.com/packages/track-any-device-sms-gateway)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M134](/packages/laravel-cashier)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

2037.5k](/packages/onlime-laravel-http-client-global-logger)

PHPackages © 2026

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