PHPackages                             kwadwokyeremeh/hubtel-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. [HTTP &amp; Networking](/categories/http)
4. /
5. kwadwokyeremeh/hubtel-laravel-sms

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

kwadwokyeremeh/hubtel-laravel-sms
=================================

Hubtel SMS Channel for Laravel ^11|^122

2.0.1(5mo ago)194MITPHPPHP ^8.2

Since Jul 29Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/kwadwokyeremeh/hubtel-laravel-sms)[ Packagist](https://packagist.org/packages/kwadwokyeremeh/hubtel-laravel-sms)[ Docs](https://github.com/norris1z/hubtel-laravel-sms-channel)[ RSS](/packages/kwadwokyeremeh-hubtel-laravel-sms/feed)WikiDiscussions main Synced 1mo ago

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

\#Hubtel notification channel for Laravel 11+

[![Latest Stable Version](https://camo.githubusercontent.com/fdc7cc8671e17c1d6c2866ba9b5994048a958a733e54576009dbe588be9a9c12/68747470733a2f2f706f7365722e707567782e6f72672f6e6f72726973317a2f68756274656c2d6c61726176656c2d736d732d6368616e6e656c2f762f737461626c65)](https://packagist.org/packages/norris1z/hubtel-laravel-sms-channel)[![Total Downloads](https://camo.githubusercontent.com/09d5a8402309512e1f7ba19d318ad801665e095e2b19e271d851a4dabadfac25/68747470733a2f2f706f7365722e707567782e6f72672f6e6f72726973317a2f68756274656c2d6c61726176656c2d736d732d6368616e6e656c2f646f776e6c6f616473)](https://packagist.org/packages/norris1z/hubtel-laravel-sms-channel)[![License](https://camo.githubusercontent.com/a7a7906243799071b96ecf5e08a0f9bf5232499b435f64d3433967aaeaf1e81c/68747470733a2f2f706f7365722e707567782e6f72672f6e6f72726973317a2f68756274656c2d6c61726176656c2d736d732d6368616e6e656c2f6c6963656e7365)](https://packagist.org/packages/norris1z/hubtel-laravel-sms-channel)

This package makes it easy to send notifications using [Hubtel](https://hubtel.com) with Laravel 11+.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the Hubtel service](#setting-up-the-hubtel-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Testing the Integration](#testing-the-integration)
- [Querying Message Status](#querying-message-status)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

To get the latest version of Hubtel Notification channel for Laravel 11+, simply require the project using [Composer](https://getcomposer.org):

Run from your terminal

```
$ composer require kwadwokyeremeh/hubtel-laravel-sms
```

### Setting up the Hubtel service

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

In your Hubtel account go to [Applications](https://developers.hubtel.com/account/api-accounts) page. Click on the details of the desired application and copy your `apiKey` and `apiSecret`

In your terminal run

```
$ php artisan vendor:publish --provider="NotificationChannels\Hubtel\HubtelServiceProvider"
```

This creates a `hubtel-sms.php` file in your `config` directory.

Paste your apiCredentials in the `config/hubtel.php` configuration file. You may copy the example configuration below to get started:

```
        'api_key' => env('HUBTEL_CLIENT_ID'),
        'api_secret' => env('HUBTEL_CLIENT_SECRET')
        'use_post_method' => env('HUBTEL_SEND_METHOD')
```

Or

Add the `HUBTEL_CLIENT_ID` and `HUBTEL_CLIENT_SECRET` to your `.env` file

Usage
-----

[](#usage)

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

```
    use Illuminate\Notifications\Notification;
    use NotificationChannels\Hubtel\HubtelChannel;
    use NotificationChannels\Hubtel\HubtelMessage;

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

        public function toSMS($notifiable)
        {
            return (new HubtelMessage)
                        ->from("JabClari")
                        ->to("2331234567890")
                        ->content("Kim Kippo... Sup with you");
        }
    }
```

In order to let your Notification know which phone number you are sending to, add the `routeNotificationForSMS` method to your Notifiable model e.g your User Model

```
public function routeNotificationForSMS()
{
    return $this->phone; // where phone is a cloumn in your users table;
}
```

### Available Message methods

[](#available-message-methods)

- `from($from)` : set the sender's name or phone number
- `to($to)` : set the recipient's phone number
- `content($content)` : set the message content
- `registeredDelivery()` : set delivery report request
- `clientReference($reference)` : set the client reference number
- `type($type)` :set the message type to be sent
- `udh($udh)` : set the User Data Header of the SMS Message being sent
- `time($time)` : set the time to deliver the message
- `flashMessage()` : sends the message as a flash message

Read more about the available methods on the [Hubtel Documentation Page](https://developers.hubtel.com/documentations/sendmessage)

Testing the Integration
-----------------------

[](#testing-the-integration)

You can test your Hubtel SMS integration using the built-in Artisan command:

```
php artisan hubtel-sms:test +1234567890 --from="SenderName" --message="Your test message here"
```

### Command Arguments and Options:

[](#command-arguments-and-options)

- `to` - Required. The recipient phone number
- `--from` - Optional. The sender ID/name (defaults to config value or 'Laravel')
- `--message` - Optional. Custom message content (defaults to a standard test message)

### Prerequisites:

[](#prerequisites)

1. Configure Hubtel API credentials in your `.env` file:

    ```
    HUBTEL_CLIENT_ID=your_client_id
    HUBTEL_CLIENT_SECRET=your_client_secret

    ```
2. Publish the config file (if not already done):

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

    ```

Querying Message Status
-----------------------

[](#querying-message-status)

The package now supports querying the status of sent messages. You can check the delivery status of a message using the `HubtelStatusChecker`:

```
    use NotificationChannels\Hubtel\SMSClients\HubtelStatusChecker;
    use GuzzleHttp\Client;
    $statusChecker = new HubtelStatusChecker($apiKey, $apiSecret, new Client());
    $response = $statusChecker->query('message-id-here');
    if ($response->isDelivered()) {
    echo "Message was delivered successfully";
     }
    // Access other status information
    $response->getStatus();
    $response->getUpdateTime();
```

You can also check message status using the built-in Artisan command:

```
php artisan hubtel-sms:status message-id-here
```

This command will display detailed information about the message including delivery status, recipient, content, and delivery time.

Changelog
---------

[](#changelog)

Latest Notice
-------------

[](#latest-notice)

For developers who would want to use this package on VPS hosted applications, if the server location is US for which you have a US IP Address, you may need to seek whitelisting of the US Ip address from hubtel by mailing . As i discovered through experience that the package would work fine on local machine because the IP used is a Ghanaian IP address but fails to work on a production server. Note however that this is not a package problem, as the package justorganizes components for sending successful SMS messages within Laravel. It is even more challenging to know the cause of the problem when you are using laravel queues, because the response codes are not logged, the queue just logs Processing failed.Hubtels SMS server responds with a 403 Forbidden, when the same SMS issent directly using Guzzlehttp on the production server (VPS). A 403 HTTP Response according to their website (hubtel) indicates the recipient has not given his/her approval to receive messages which is even more confusing. :)

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

Testing
-------

[](#testing)

```
$ composer test
```

To run the live tests, you need to set the required environment variables. Here's how you can do it: First, you need to set the environment variables with your Hubtel API credentials:

```
export HUBTEL_CLIENT_ID=your-api-key
export HUBTEL_CLIENT_SECRET=your-api-secret
export RUN_LIVE_TESTS=true
export HUBTEL_SEND_METHOD=true // true for POST method, false for GET method
export HUBTEL_SENDER_ID=your-sender-id
export HUBTEL_PHONE_NUMBER=your-phone-number
```

Then, run the tests:

```
 vendor/bin/phpunit --group=live --dont-report-useless-tests
```

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)

- [Kwadwo Kyeremeh Tuffour](https://github.com/kwadwokyeremeh)
- [Norris Oduro Tei](https://github.com/Norris1z)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance70

Regular maintenance activity

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.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 ~95 days

Recently: every ~71 days

Total

6

Last Release

175d ago

Major Versions

1.6 → 2.02025-11-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/99ddbbb67396f6e60e5e14f1836686788ce5bc6f83f1c44577266cd12dcd29a8?d=identicon)[kwadwokyeremeh](/maintainers/kwadwokyeremeh)

---

Top Contributors

[![kwadwokyeremeh](https://avatars.githubusercontent.com/u/20841644?v=4)](https://github.com/kwadwokyeremeh "kwadwokyeremeh (28 commits)")[![Norris1z](https://avatars.githubusercontent.com/u/18237132?v=4)](https://github.com/Norris1z "Norris1z (21 commits)")[![hinimajesty](https://avatars.githubusercontent.com/u/19369546?v=4)](https://github.com/hinimajesty "hinimajesty (5 commits)")

---

Tags

laravelsmshubtelserenityquery-sms

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[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/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)

PHPackages © 2026

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