Download the PHP package moffhub/ussd without Composer

On this page you can find all versions of the php package moffhub/ussd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ussd

Moffhub USSD Framework

A powerful, enterprise-grade Laravel package for building scalable USSD applications with support for multiple African mobile network providers.

Features

Requirements

Installation

Publish the configuration file:

Run migrations (optional, for session persistence and analytics):

Quick Start

1. Create a USSD Controller

2. Register the Route

Menu Types

SimpleMenu

Basic menu with numbered options:

FormMenu

Collect multi-step form data:

PaginatedMenu

Display large lists with pagination:

ConditionalMenu

Show different menus based on conditions:

WizardMenu

Multi-step guided processes:

Using the MenuBuilder

Fluent interface for building menus:

Type-Safe Menu Names with Enums

For better type safety and IDE autocomplete, use enums for menu names:

Creating Your Menu Enum

Using Your Enum

Provider Adapters

The framework automatically detects the USSD provider from the request, or you can specify one:

Supported Providers

Provider Aliases Field Mapping
Safaricom safaricom, africas_talking, at phoneNumber, text, sessionId
Airtel airtel msisdn, input/text, transactionId
MTN mtn msisdn, UserAnswer, sessionId
Generic generic Auto-detect multiple field names

Register Custom Provider

Data Providers

ArrayDataProvider

DatabaseDataProvider

ApiDataProvider

Session Management

Accessing Session Data

Session Recovery

The framework automatically handles session recovery:

Security Features

Rate Limiting

Database-Backed Whitelist/Blacklist

For production applications, use database-backed access lists that can be managed via a UI:

Using the UssdAccessList Model Directly

Build your own admin UI using the Eloquent model:

Custom Access List Provider

Implement your own storage backend:

Input Sanitization

Validators

Built-in validators for form fields:

Response Types

Configuration

Full configuration options:

Facade

Use the Ussd facade for convenient access:

Internationalization (i18n)

Built-in multi-language support:

Publish and customize language files:

Configure in config/ussd.php:

Signature Verification

Verify incoming provider requests using HMAC signatures:

Circuit Breaker

Protect external API calls from cascading failures:

The circuit breaker is automatically integrated into ApiDataProvider. It supports three states:

Session Encryption

Encrypt sensitive session data at rest:

Configure which fields to encrypt in config/ussd.php:

Events

The framework dispatches Laravel events at key lifecycle points:

Event Payload
SessionStarted sessionId, phone, provider
SessionResumed sessionId, phone, wasRecovered
SessionEnded sessionId, phone, duration, menusVisited
SessionExpired sessionId, phone, lastMenu
MenuEntered sessionId, menuName, fromMenu
MenuExited sessionId, menuName, toMenu, selection
FormSubmitted sessionId, menuName, formData
InputReceived sessionId, menuName, rawInput
NavigationPerformed sessionId, action

Listen to events:

Artisan Commands

Middleware

Two middleware are registered automatically:

Production Deployment

See docs/PRODUCTION.md for a detailed production deployment guide including:

Quick Checklist

Local Development

USSD Simulator

Test your USSD flows interactively from the command line without needing a real gateway:

This starts an interactive CLI session that simulates a USSD flow. It sends requests to your registered menus, displays responses, and prompts for input just like a real USSD session.

Options

How It Works

  1. The simulator generates a unique session ID and sends an initial request to UssdFramework::handle()
  2. The response is displayed in the terminal with [CON] (continue) or [END] (end) indicators
  3. If the response is CON, you are prompted to enter input
  4. The simulator sends a follow-up request with your input
  5. This loop continues until the response is END or you type exit
  6. A session summary is displayed at the end with total steps and duration

Testing

Run the test suite:

Or with PHPUnit directly:

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for your changes
  4. Submit a pull request

License

This package is open-sourced software licensed under the MIT license.

Credits


All versions of ussd with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4 || ^8.5
laravel/framework Version ^12.0 || ^13.0
sourcetoad/enhanced-resources Version ^7.3
sourcetoad/rule-helper-for-laravel Version ^6.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moffhub/ussd contains the following files

Loading the files please wait ...