PHPackages                             james-kabz/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. james-kabz/sms

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

james-kabz/sms
==============

Laravel package for integrating sms notifications

v0.0.2(3mo ago)021MITPHPPHP ^8.1CI passing

Since Feb 3Pushed 3mo agoCompare

[ Source](https://github.com/James-Kabz/sms)[ Packagist](https://packagist.org/packages/james-kabz/sms)[ RSS](/packages/james-kabz-sms/feed)WikiDiscussions main Synced 1mo ago

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

james-kabz/sms
==============

[](#james-kabzsms)

Laravel package for sending SMS via Africa's Talking and Twilio.

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

[](#requirements)

- PHP 8.1+
- Laravel 10/11/12

Installation (local path)
-------------------------

[](#installation-local-path)

1. Add repository and require the package in your app `composer.json`:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "packages/james-kabz/sms"
    }
  ],
  "require": {
    "james-kabz/sms": "*"
  }
}
```

2. Install:

```
composer update james-kabz/sms
```

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

[](#configuration)

Publish the config (optional):

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

Add credentials to your `.env`:

```
AFRICASTALKING_USERNAME=your_username
AFRICASTALKING_API_KEY=your_api_key
AFRICASTALKING_FROM=your_sender_id

```

Twilio (optional):

```
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM=your_twilio_number
TWILIO_MESSAGING_SERVICE_SID=your_messaging_service_sid

```

Optional overrides:

```
AFRICASTALKING_SMS_ENDPOINT=https://api.africastalking.com/version1/messaging
AFRICASTALKING_TIMEOUT=15
AFRICASTALKING_BULK_MODE=1

SMS_DRIVER=africastalking
SMS_LOGGING=true
SMS_WEBHOOK_ENABLED=false
SMS_WEBHOOK_PATH=sms/webhook

```

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use JamesKabz\Sms\Facades\Sms;

Sms::send('+2547XXXXXXXX', 'Hello from Africa\'s Talking');
```

### Drivers

[](#drivers)

Set the default driver in `.env`:

```
SMS_DRIVER=africastalking

```

Use Twilio:

```
SMS_DRIVER=twilio

```

To add another driver, define it in `config/sms.php` under `drivers` with a `class` key that implements `JamesKabz\\Sms\\Contracts\\SmsDriver`, then set `SMS_DRIVER` to that name.

### Send with a template

[](#send-with-a-template)

```
// config/sms.php -> templates['compliance_notice']
Sms::sendTemplate('compliance_notice', '+2547XXXXXXXX', [
    'name' => 'Amina',
    'status' => 'COMPLIANT',
]);
```

### Dependency Injection

[](#dependency-injection)

```
use JamesKabz\Sms\Services\SmsManager;

public function send(SmsManager $sms)
{
    $sms->send(['+2547XXXXXXXX', '+2547YYYYYYYY'], 'Hello!');
}
```

### Per-call options

[](#per-call-options)

```
Sms::send('+2547XXXXXXXX', 'Hello', [
    'from' => 'MyBrand',
    'bulkSMSMode' => 1,
]);
```

Notifications (SmsChannel)
--------------------------

[](#notifications-smschannel)

```
use Illuminate\\Notifications\\Notification;
use JamesKabz\\Sms\\Notifications\\SmsChannel;

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

    public function toSms($notifiable): array
    {
        return [
            'template' => 'compliance_notice',
            'data' => ['name' => $notifiable->name, 'status' => $notifiable->status],
        ];
    }
}
```

To resolve the phone number, implement `routeNotificationForSms()` on your notifiable or provide a `phone` / `phone_number` field.

Logging
-------

[](#logging)

When `SMS_LOGGING=true`, send attempts are stored in the `sms_logs` table. Run migrations in your app:

```
php artisan migrate
```

Webhook (delivery reports)
--------------------------

[](#webhook-delivery-reports)

Enable in `.env`:

```
SMS_WEBHOOK_ENABLED=true
SMS_WEBHOOK_PATH=sms/webhook

```

This registers a POST endpoint that stores the payload in `sms_logs` (when logging is enabled).

Response format
---------------

[](#response-format)

`send()` returns a structured array:

```
[
    'success' => true,
    'status' => 201,
    'data' => [...],
    'body' => '...'
]
```

Notes
-----

[](#notes)

- Ensure your sender ID (`AFRICASTALKING_FROM`) is approved in Africa's Talking.
- For production, use your live username and API key (not the sandbox).
- Twilio requires either `TWILIO_FROM` or `TWILIO_MESSAGING_SERVICE_SID`.

Testing (package)
-----------------

[](#testing-package)

```
cd packages/james-kabz/sms
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance87

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

94d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a23b4d45b221e84b2f9c7c3261d1d8dc7758105d8bd31849c7eb0e1df8a5c008?d=identicon)[james-kabz](/maintainers/james-kabz)

---

Top Contributors

[![James-Kabz](https://avatars.githubusercontent.com/u/146638563?v=4)](https://github.com/James-Kabz "James-Kabz (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/james-kabz-sms/health.svg)

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

###  Alternatives

[laravel/cashier

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

2.5k25.9M106](/packages/laravel-cashier)[beyondcode/laravel-mailbox

Handle incoming emails in your Laravel application.

1.1k1.0M4](/packages/beyondcode-laravel-mailbox)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[api-platform/laravel

API Platform support for Laravel

59126.4k5](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1225.0k10](/packages/fleetbase-core-api)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)

PHPackages © 2026

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