PHPackages                             swiftsmsgh-laravel-notification-channels/swiftsmsgh - 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. swiftsmsgh-laravel-notification-channels/swiftsmsgh

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

swiftsmsgh-laravel-notification-channels/swiftsmsgh
===================================================

swiftsms-GH SMS Notification Channel For Laravel

v1.0.3(4mo ago)010MITPHPPHP &gt;=8.1CI passing

Since Jan 9Pushed 4mo agoCompare

[ Source](https://github.com/supreme-majesty/swiftsmsgh-laravel-notification-channels)[ Packagist](https://packagist.org/packages/swiftsmsgh-laravel-notification-channels/swiftsmsgh)[ Docs](https://github.com/supreme-majesty/swiftsmsgh-laravel-notification-channels.git)[ RSS](/packages/swiftsmsgh-laravel-notification-channels-swiftsmsgh/feed)WikiDiscussions main Synced 1mo ago

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

Swiftsmsgh Notification Channel
===============================

[](#swiftsmsgh-notification-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e5cb88ce5e00f16f07830dad77b2ed1032440a2ef9657dcec36718cd397f7bcb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7377696674736d7367682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/swiftsmsgh)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/be92caeb7a6f15e092c3ec0ea35a384bcd9121442a632a62adb7b2bf171938e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7377696674736d7367682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/laravel-notification-channels/swiftsmsgh/actions)[![StyleCI](https://camo.githubusercontent.com/e838d158007624ad28bb69514939f166c4d959588dad7ce8648cf879c931398b/68747470733a2f2f7374796c6563692e696f2f7265706f732f3333393839323230342f736869656c64)](https://styleci.io/repos/339892204)[![Total Downloads](https://camo.githubusercontent.com/3ccebaec978a147b727eeb68b6f80424f5950777c196b481a62ffba210cdc3d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7377696674736d7367682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/swiftsmsgh)

📲 [Swiftsmsgh](https://app.swiftsmsgh.com) Notifications Channel for Laravel.
This package makes it easy to send SMS notifications with Swiftsms-GH using the official [swiftsmsgh-api-sdk](https://github.com/swiftsmsgh/swiftsmsgh-api-sdk).

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the Swiftsmsgh service](#setting-up-the-Swiftsmsgh-service)
- [Usage](#usage)
    - [Basic SMS](#basic-sms)
    - [Scheduled SMS](#scheduled-sms)
    - [Voice Call](#voice-call)
    - [MMS Message](#mms-message)
    - [Whatsapp Message](#whatsapp-message)
    - [Available methods](#available-methods)
- [Error Handling](#error-handling)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require laravel-notification-channels/swiftsmsgh
```

### Configuration

[](#configuration)

Add your Swiftsmsgh SENDER\_ID and API\_TOKEN to your `.env`

```
SWIFTSMSGH_API_TOKEN=100|yourapitoken # always required
SWIFTSMSGH_SENDER_ID=Demo # always required
```

Add the configuration to your `services.php` config file:

```
'swiftsmsgh' => [
    'sender_id' => env('SWIFTSMSGH_SENDER_ID', 'sender_id'),
    'api_token' => env('SWIFTSMSGH_API_TOKEN', 'api_token'),
]
```

### Setting up the Swiftsmsgh service

[](#setting-up-the-swiftsmsgh-service)

You'll need a Swiftsms-GH account. Head over to their [website](https://www.app.swiftsmsgh.com/) and create or login to your account.

Navigate to `API Integration` and then `API Token` in the sidebar to copy existing one or generate an API Token.

Usage
-----

[](#usage)

You can use the channel in your `via()` method inside the notification:

```
use Illuminate\Notifications\Notification;
use NotificationChannels\Swiftsmsgh\SwiftsmsghMessage;
use NotificationChannels\Swiftsmsgh\SwiftsmsghChannel;

class InvoicePaid extends Notification
{
    public function via($notifiable)
    {
        return [SwiftsmsghChannel::class];
    }

    public function toSwiftsmsgh($notifiable)
    {
        return (new SwiftsmsghMessage)
            ->content("Your invoice has been paid! Amount: {$this->amount}")
            ->from('MyApp');
    }
}
```

In your notifiable model, make sure to include a `routeNotificationForSwiftsmsgh()` method, which returns a phone number including country code.

```
public function routeNotificationForSwiftsmsgh()
{
    return $this->phone; // 233200000000
}
```

### Basic SMS

[](#basic-sms)

```
public function toSwiftsmsgh($notifiable)
{
    return SwiftsmsghMessage::create("Hello there!");
}
```

### Scheduled SMS

[](#scheduled-sms)

You can schedule messages to be sent at a later time:

```
public function toSwiftsmsgh($notifiable)
{
    return (new SwiftsmsghMessage("Happy Birthday!"))
        ->from('MyCompany')
        ->schedule(now()->addDay())
        ->campaign('BirthdayBlast')
        ->callbackUrl('https://example.com/delivery-report');
}
```

### Voice Call

[](#voice-call)

Send a text-to-speech voice call:

```
public function toSwiftsmsgh($notifiable)
{
    return SwiftsmsghMessage::createVoice("Your verification code is 1234");
}
```

### MMS Message

[](#mms-message)

Send a multimedia message (requires a public media URL):

```
public function toSwiftsmsgh($notifiable)
{
    return SwiftsmsghMessage::createMms(
        "Check out this image!",
        "https://example.com/image.jpg"
    );
}
```

### Whatsapp Message

[](#whatsapp-message)

```
public function toSwiftsmsgh($notifiable)
{
    return SwiftsmsghMessage::createWhatsapp("Hello from Whatsapp API!");
}
```

### Available methods

[](#available-methods)

- `content(string $content)`: Set the message content.
- `from(string $sender)` or `sender(string $sender)`: Set the sender ID.
- `schedule(DateTimeInterface $time)`: Schedule the message for a future time.
- `campaign(string $name)`: Set a campaign name for reporting.
- `callbackUrl(string $url)`: Set a callback URL for delivery reports.
- `reference(string $ref)`: Set a custom reference ID.

Error Handling
--------------

[](#error-handling)

If the API request fails (e.g. invalid credentials, insufficient balance), the channel will throw a `NotificationChannels\Swiftsmsgh\Exceptions\CouldNotSendNotification` exception.

This allows you to leverage Laravel's built-in notification retry mechanism or handle failures gracefully.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Majesty-Scofield](https://github.com/majesty-scofield)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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

4

Last Release

124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e9bb96a6b0aead315e525daa1f5ffda25453fe82ba93bf5153de0ae69fa04b5?d=identicon)[supreme-majesty](/maintainers/supreme-majesty)

---

Top Contributors

[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (12 commits)")[![supreme-majesty](https://avatars.githubusercontent.com/u/222682860?v=4)](https://github.com/supreme-majesty "supreme-majesty (12 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (7 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (7 commits)")[![irazasyed](https://avatars.githubusercontent.com/u/1915268?v=4)](https://github.com/irazasyed "irazasyed (6 commits)")[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (4 commits)")[![lukewaite](https://avatars.githubusercontent.com/u/618130?v=4)](https://github.com/lukewaite "lukewaite (2 commits)")[![casperboone](https://avatars.githubusercontent.com/u/15815208?v=4)](https://github.com/casperboone "casperboone (2 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (1 commits)")[![askmrsinh](https://avatars.githubusercontent.com/u/6129517?v=4)](https://github.com/askmrsinh "askmrsinh (1 commits)")[![talvbansal](https://avatars.githubusercontent.com/u/7305131?v=4)](https://github.com/talvbansal "talvbansal (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/swiftsmsgh-laravel-notification-channels-swiftsmsgh/health.svg)

```
[![Health](https://phpackages.com/badges/swiftsmsgh-laravel-notification-channels-swiftsmsgh/health.svg)](https://phpackages.com/packages/swiftsmsgh-laravel-notification-channels-swiftsmsgh)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[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/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[laravel-notification-channels/aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel.

541.1M2](/packages/laravel-notification-channels-aws-sns)

PHPackages © 2026

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