PHPackages                             jowusu837/hubtel-ussd-plugin-laravel - 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. jowusu837/hubtel-ussd-plugin-laravel

AbandonedLibrary[API Development](/categories/api)

jowusu837/hubtel-ussd-plugin-laravel
====================================

Hubtel USSD plugin for easy integration into Laravel projects

1.0.1(8y ago)61.1k5MITPHP

Since Oct 31Pushed 6y ago4 watchersCompare

[ Source](https://github.com/jowusu837/hubtel-ussd-plugin-laravel)[ Packagist](https://packagist.org/packages/jowusu837/hubtel-ussd-plugin-laravel)[ RSS](/packages/jowusu837-hubtel-ussd-plugin-laravel/feed)WikiDiscussions master Synced yesterday

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

Hubtel USSD plugin for Laravel
==============================

[](#hubtel-ussd-plugin-for-laravel)

[![Latest Release on GitHub](https://camo.githubusercontent.com/166ec85eb32257e8e4a898a54119a322258da009a127809f84dedc924af7e98c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6a6f777573753833372f68756274656c2d757373642d706c7567696e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jowusu837/hubtel-ussd-plugin-laravel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/e194de22de0c9366d6dc5503a55127fe689db15faf5a51e84f9131af1d1b9dfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f777573753833372f68756274656c2d757373642d706c7567696e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jowusu837/hubtel-ussd-plugin-laravel)

Based on [Hubtel's USSD API](https://developers.hubtel.com/documentations/ussd)

About
-----

[](#about)

This package allows you to integrate Hubtel USSD service directly into your existing Laravel application. This allows users to access your application on USSD like **\*1234#**. Check out [this link](https://developers.hubtel.com/documentations/ussd#how-to-get-ussd-short-code) to know how you can acquire a USSD code from Hubtel.

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

[](#installation)

Require the `jowusu837/hubtel-ussd-plugin-laravel` package in your `composer.json` and update your dependencies:

```
$ composer require jowusu837/hubtel-ussd-plugin-laravel
```

If you're using Laravel 5.5, this is all there is to do.

Should you still be on older versions of Laravel, the final steps for you are to add the service provider of the package and alias the package. To do this open your `config/app.php` file.

Add the HubtelUssd\\ServiceProvider to your `providers` array:

```
Jowusu837\HubtelUssd\ServiceProvider::class,
```

Usage
-----

[](#usage)

Your application should now have an endpoint for USSD access. You can use the [Hubtel USSD Simulator](http://apps.hubtel.com/USSDSimulator/) to test your it out by supplying your application url as:

Customization
-------------

[](#customization)

Your application should have the default USSD flow just to show you the the plugin is working. You create your own custom USSD flows by simply creating `Activities`. You can start by creating a new folder in your `app` directory called `USSD`. This is where you will store all your USSD related logic.

A USSD activity is just a simple `php` class that extends the `UssdActivity` class. Here's how it looks like:

```
namespace App\Ussd\Activities;

use App\Ussd\Activities\MenuSelection;
use Jowusu837\HubtelUssd\Lib\UssdActivity;
use Jowusu837\HubtelUssd\Lib\UssdResponse;

class HomeActivity extends UssdActivity
{
    public function run() {
        $this->response->Type = UssdResponse::RELEASE;
        $this->response->Message = 'Ussd is working!';
        return $this;
    }

    public function next() {
        return MenuSelection::class;
    }

}
```

So basically, an activity class such as the one above must implement 2 methods: `run()` and `next()`. The `run()` method is the main entry point for the activity and must always return `$this`. The `next()` must just return a reference to the next activity to be executed. You can do this by simply returning a string with the full namespace to the activity class or you can use the `::class` approach to have php resolve that for you.

You have access to the current request `$this->request`, the response to be sent `$this->response`, and the current USSD session `$this->session` from within the activity as well. The request and response properties exposes all the properties of a USSD request and response respectively as documented [here](https://developers.hubtel.com/documentations/ussd/reference). The session property however is just an array. Note that the session is implemented on top of your existing Laravel cache. The session allows you to persist state throughout your USSD session. You can store a value in the session like so: `$this->session['name'] = 'John Doe'`, and retrieve it elsewhere like so: `$name = $this->session['name']`.

Once you have created your activiy files, you need to set your entry point activity in the config file as shown in the next section.

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

[](#configuration)

The defaults are set in `config/hubtel-ussd.php`. Copy this file to your own config directory to modify the values. You can publish the config using this command:

```
$ php artisan vendor:publish --provider="Jowusu837\HubtelUssd\ServiceProvider"
```

```
return [
    "home" => \App\Ussd\Activities\HomeActivity::class
];
```

License
-------

[](#license)

Released under the MIT License, see [LICENSE](LICENSE).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 94.3% 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 ~79 days

Total

2

Last Release

3036d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c366bb7b587c45278037ba03e10ee9fd2a813fbc9023f237ded8d50b4f8deb4e?d=identicon)[jowusu837](/maintainers/jowusu837)

---

Top Contributors

[![jowusu837](https://avatars.githubusercontent.com/u/1615922?v=4)](https://github.com/jowusu837 "jowusu837 (33 commits)")[![BaffourAdu](https://avatars.githubusercontent.com/u/22221905?v=4)](https://github.com/BaffourAdu "BaffourAdu (1 commits)")[![macleash90](https://avatars.githubusercontent.com/u/47404661?v=4)](https://github.com/macleash90 "macleash90 (1 commits)")

---

Tags

hubtel-ussdlaravelussdpluginlaravelsmsussdhubtel

### Embed Badge

![Health badge](/badges/jowusu837-hubtel-ussd-plugin-laravel/health.svg)

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

###  Alternatives

[aloha/twilio

Twilio API for Laravel

4733.6M5](/packages/aloha-twilio)[kavenegar/laravel

laravel 4 and 5 kavenegar integration

87336.7k4](/packages/kavenegar-laravel)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)

PHPackages © 2026

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