PHPackages                             erbitron/dialog-esms - 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. [API Development](/categories/api)
4. /
5. erbitron/dialog-esms

ActiveLibrary[API Development](/categories/api)

erbitron/dialog-esms
====================

PHP and Laravel client for Dialog eSMS API Sri Lanka

v1.0.1(1mo ago)125MITPHPPHP ^8.1CI passing

Since Jul 2Pushed 1mo agoCompare

[ Source](https://github.com/bandaranaike/dialog-esms)[ Packagist](https://packagist.org/packages/erbitron/dialog-esms)[ Docs](https://github.com/bandaranaike/dialog-esms)[ RSS](/packages/erbitron-dialog-esms/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Dialog eSMS
===========

[](#dialog-esms)

PHP 8.1+ client for the Dialog Axiata Sri Lanka eSMS API, published on Packagist and ready for Laravel or plain PHP projects.

[![Packagist Version](https://camo.githubusercontent.com/437f786e419ce4ac7bcd7dd285dbd4381a245d75e8497a6b1897cf7cd2ab7c33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6572626974726f6e2f6469616c6f672d65736d732e737667)](https://packagist.org/packages/erbitron/dialog-esms)[![Packagist Downloads](https://camo.githubusercontent.com/7fb220347aad7357ae463f24576f13dfeb513b2e849277ec2b9210be2cd05f78/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6572626974726f6e2f6469616c6f672d65736d732e737667)](https://packagist.org/packages/erbitron/dialog-esms)[![CI](https://github.com/bandaranaike/dialog-esms/actions/workflows/ci.yml/badge.svg)](https://github.com/bandaranaike/dialog-esms/actions/workflows/ci.yml)

Source repository: Packagist: Docs index: [docs/README.md](docs/README.md)

Contents
--------

[](#contents)

- [Installation](#installation)
- [Plain PHP usage](#plain-php-usage)
- [Laravel usage](#laravel-usage)
- [Environment variables](#environment-variables)
- [Config publishing](#config-publishing)
- [Send SMS example](#send-sms-example)
- [Check balance example](#check-balance-example)
- [Error handling example](#error-handling-example)
- [Contributing](#contributing)
- [Security](#security)
- [Release](#release)
- [License](#license)

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

[](#installation)

### Install from Packagist

[](#install-from-packagist)

```
composer require erbitron/dialog-esms
```

### Local development with a path repository

[](#local-development-with-a-path-repository)

If you are working on the package locally, add this to your application `composer.json`:

```
"repositories": [
  {
    "type": "path",
    "url": "../dialog-esms"
  }
]
```

Then install the package:

```
composer require erbitron/dialog-esms
```

### Install directly from GitHub during development

[](#install-directly-from-github-during-development)

If you want to install from the GitHub repository directly, add a VCS repository entry:

```
"repositories": [
  {
    "type": "vcs",
    "url": "https://github.com/bandaranaike/dialog-esms"
  }
]
```

Then require it normally:

```
composer require erbitron/dialog-esms
```

### Notes

[](#notes)

- For normal projects, installing from Packagist is the recommended path.
- Use the path or VCS repository entries only for local development or when you need an unpublished change.

Plain PHP usage
---------------

[](#plain-php-usage)

```
use Erbitron\DialogESMS\DialogESMSClient;

$client = new DialogESMSClient('your-api-key');

$response = $client->sendMessage(
    recipients: '94771234567',
    message: 'Hello from website',
    sourceAddress: 'YourBrand'
);

if ($response->successful()) {
    echo 'SMS sent';
} else {
    echo $response->message;
}
```

Laravel usage
-------------

[](#laravel-usage)

The package is auto-discovered by Laravel.

```
use Erbitron\DialogESMS\DialogESMSClient;

class SmsController
{
    public function send(DialogESMSClient $sms)
    {
        $response = $sms->sendMessage(
            recipients: '94771234567',
            message: 'Your OTP is 123456',
            sourceAddress: 'YourBrand'
        );

        return $response->message;
    }
}
```

You can also use the facade:

```
use DialogESMS;

$response = DialogESMS::checkBalance();
```

Environment variables
---------------------

[](#environment-variables)

```
DIALOG_ESMS_API_KEY=your-api-key
DIALOG_ESMS_CALLBACK_URL=https://your-site.com/dialog-esms/callback
```

Optional:

```
DIALOG_ESMS_BASE_URL=https://e-sms.dialog.lk/api/v1/message-via-url
```

Config publishing
-----------------

[](#config-publishing)

Publish the Laravel config file:

```
php artisan vendor:publish --tag=dialog-esms-config
```

Send SMS example
----------------

[](#send-sms-example)

```
use Erbitron\DialogESMS\DialogESMSClient;

$client = new DialogESMSClient('your-api-key');

$response = $client->sendMessage(
    recipients: '94771234567',
    message: 'Hello from website',
    sourceAddress: 'YourBrand'
);

if ($response->successful()) {
    echo 'SMS sent';
} else {
    echo $response->message;
}
```

Check balance example
---------------------

[](#check-balance-example)

```
use Erbitron\DialogESMS\DialogESMSClient;

$client = new DialogESMSClient('your-api-key');
$response = $client->checkBalance();

echo $response->message;
echo $response->balance ?? '';
```

Error handling example
----------------------

[](#error-handling-example)

```
use Erbitron\DialogESMS\DialogESMSClient;
use Erbitron\DialogESMS\Exceptions\DialogESMSException;

try {
    $client = new DialogESMSClient('your-api-key');
    $response = $client->sendMessage(
        recipients: '94771234567',
        message: 'Hello',
        sourceAddress: 'YourBrand'
    );
} catch (DialogESMSException $e) {
    report($e);
}
```

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution workflow and local checks.

Security
--------

[](#security)

If you discover a security issue, do not open a public issue with exploit details. Please report it through GitHub Security Advisories or create a private security report for the repository if available.

Release
-------

[](#release)

See [RELEASE.md](RELEASE.md) for the release checklist and Packagist publishing flow.

License
-------

[](#license)

This package is released under the MIT license. See the [LICENSE](LICENSE) file in the repository.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

2

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6285773?v=4)[Eranda Bandaranaike](/maintainers/bandaranaike)[@bandaranaike](https://github.com/bandaranaike)

---

Top Contributors

[![eranda-antlabs](https://avatars.githubusercontent.com/u/206700856?v=4)](https://github.com/eranda-antlabs "eranda-antlabs (1 commits)")

---

Tags

phpapilaravelsmsdialogsri-lankadialog-esms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/erbitron-dialog-esms/health.svg)

```
[![Health](https://phpackages.com/badges/erbitron-dialog-esms/health.svg)](https://phpackages.com/packages/erbitron-dialog-esms)
```

###  Alternatives

[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162158.4k1](/packages/joisarjignesh-bigbluebutton)[lakshmaji/plivo

Send SMS using Plivo Cloud API

2016.9k](/packages/lakshmaji-plivo)[lakshmajim/plivo

Send SMS using Plivo Cloud API

205.7k](/packages/lakshmajim-plivo)[jeroen-g/flickr

Modern PHP package to make Flickr API calls. Ships with Laravel implementation.

2564.3k2](/packages/jeroen-g-flickr)[exlo89/laravel-sevdesk-api

A helpful Sevdesk API client for Laravel.

1118.8k](/packages/exlo89-laravel-sevdesk-api)[dystcz/lunar-api

Dystore API layer for Lunar e-commerce package

421.2k3](/packages/dystcz-lunar-api)

PHPackages © 2026

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