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

ActiveLibrary[API Development](/categories/api)

banulakwin/laravel-sms
======================

Portable Laravel SMS package with multi-provider driver architecture.

1.0.0(3w ago)00MITPHPPHP ^8.2CI passing

Since May 18Pushed 3w agoCompare

[ Source](https://github.com/banulalakwindu/laravel-sms)[ Packagist](https://packagist.org/packages/banulakwin/laravel-sms)[ Docs](https://github.com/banulalakwindu/laravel-sms)[ RSS](/packages/banulakwin-laravel-sms/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Laravel SMS (`banulakwin/laravel-sms`)
======================================

[](#laravel-sms-banulakwinlaravel-sms)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6214b6da1e8e40cb4b4eb62b1435bc2d7e362e5f083bed588a5f5e811cd0e33d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616e756c616b77696e2f6c61726176656c2d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/banulakwin/laravel-sms)[![Tests](https://github.com/banulalakwindu/laravel-sms/actions/workflows/tests.yml/badge.svg)](https://github.com/banulalakwindu/laravel-sms/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/ce96c91b48a4816228a28057dacbf0cb69103352a24926bdeba4991a869de50d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616e756c616b77696e2f6c61726176656c2d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/banulakwin/laravel-sms)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Portable Laravel SMS package with multi-provider driver architecture. Currently supports **TextLK** with scheduled message support.

---

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

[](#requirements)

- PHP `^8.2`
- Laravel `^11.0|^12.0|^13.0`

---

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

[](#installation)

```
composer require banulakwin/laravel-sms
php artisan vendor:publish --tag=sms-config
```

---

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

[](#configuration)

Add these environment variables to your `.env`:

```
SMS_DRIVER=textlk
TEXTLK_SMS_API_KEY=your_api_key_here
TEXTLK_SMS_SENDER_ID=YourName
```

---

Usage
-----

[](#usage)

### Send SMS

[](#send-sms)

```
use Banulakwin\Sms\DTOs\SendSmsRequest;

// Send to a single recipient (uses default driver)
$response = sms()->send(new SendSmsRequest(
    recipients: ['94712345678'],
    message: 'Your OTP is 1234',
));

// Send to multiple recipients
$response = sms()->send(new SendSmsRequest(
    recipients: ['94712345678', '94771234567', '94701234567'],
    message: 'Bulk notification message',
));

// Override sender ID per-request
$response = sms()->send(new SendSmsRequest(
    recipients: ['94712345678'],
    message: 'Hello!',
    senderId: 'CustomName',
));
```

### Schedule SMS

[](#schedule-sms)

```
$response = sms()->schedule(
    new SendSmsRequest(
        recipients: ['94712345678'],
        message: 'Happy Birthday!',
    ),
    scheduleTime: '2025-12-25 10:00',
);
```

### Explicit Driver Selection

[](#explicit-driver-selection)

```
$response = sms()->driver('textlk')->send(new SendSmsRequest(
    recipients: ['94712345678'],
    message: 'Hello via TextLK!',
));
```

### Response Handling

[](#response-handling)

```
if ($response->success) {
    echo "Sent! Cost: {$response->cost}";
    echo "Status: {$response->status->value}"; // 'sent', 'scheduled', 'failed'
} else {
    echo "Failed: {$response->message}";
}

// Access raw provider response
$rawData = $response->raw;
```

---

Features
--------

[](#features)

- Multi-provider driver architecture (TextLK included).
- Sri Lankan phone number normalization (94XXXXXXXXX format).
- Scheduled SMS delivery support.
- DTO-based request/response for type safety.
- Global `sms()` helper function.
- Configurable provider registration.
- Comprehensive logging for debugging.

---

Phone Number Normalization
--------------------------

[](#phone-number-normalization)

The TextLK provider automatically normalizes phone numbers to the Sri Lankan format:

InputOutput`94712345678``94712345678``0712345678``94712345678``+94712345678``94712345678``712345678``94712345678`Non-Sri-Lankan numbers are skipped and logged.

---

Testing
-------

[](#testing)

```
composer test          # Run PHPUnit
composer pint          # Fix code style
composer phpstan       # Static analysis
composer quality       # Run all (pint + phpstan + test)
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for details.

---

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

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/your-feature`)
3. Run `composer quality` to ensure tests and style pass
4. Commit and push
5. Open a pull request

---

Package layout (reference)
--------------------------

[](#package-layout-reference)

```
src/
  SmsServiceProvider.php
  helpers.php
  Contracts/
    SmsProviderInterface.php
  DTOs/
    SendSmsRequest.php
    SendSmsResponse.php
  Enums/
    SmsProvider.php
    SmsStatus.php
  Exceptions/
    SmsException.php
  Managers/
    SmsManager.php
  Providers/
    TextLk/
      TextLkSmsProvider.php
config/
  sms.php

```

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) for details.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

22d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64958389?v=4)[Banula Lakwindu](/maintainers/banulalakwindu)[@banulalakwindu](https://github.com/banulalakwindu)

---

Top Contributors

[![banulalakwindu](https://avatars.githubusercontent.com/u/64958389?v=4)](https://github.com/banulalakwindu "banulalakwindu (3 commits)")

---

Tags

laravelsmsmessaginggatewaytextlk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3634.4M32](/packages/mollie-laravel-mollie)

PHPackages © 2026

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