- How do I install and configure the moffhub/ussd package in Laravel?
- Run composer require moffhub/ussd, then publish the config with php artisan vendor:publish --provider="Moffhub\Ussd\UssdServiceProvider". Migrations are optional and only needed for session persistence and analytics, so run php artisan migrate if you want database-backed sessions. After that, add a route in routes/api.php and a controller that calls UssdFramework::handle() and returns formatForNetwork() as text/plain.
- Which Laravel and PHP versions does moffhub/ussd require?
- The package requires PHP 8.4 or higher and Laravel 12.0 or higher. That version floor excludes most current Laravel 10 and 11 estates, so adopting it may force a framework upgrade first. Budget for that upgrade as part of the integration cost before committing to the package.
- How does moffhub/ussd handle multiple USSD providers like Safaricom, Airtel, and MTN?
- It ships provider adapters for Safaricom/Africa's Talking, Airtel, MTN, and a generic fallback, plus a registration hook for custom providers. Each adapter normalizes the incoming webhook payload, and the framework serializes the reply through formatForNetwork(). Provider auto-detection is heuristic, so pin the provider explicitly per route or aggregator in production to avoid misclassified payloads and silently empty sessions.
- How does the package keep USSD session state between keypresses?
- Because telco aggregators POST a stateless webhook on every keypress, the framework rehydrates session state between hops and preserves context across menus. It supports session recovery and grace periods, and migrations enable optional database persistence. Align the telco session TTL with the framework's grace_period so users are not dropped mid-flow.
- Does moffhub/ussd deduplicate retried USSD webhook payloads?
- There is no documented built-in idempotency guarantee, and USSD webhooks do retry. On money-moving flows a duplicate delivery means a double debit, so assume deduplication is your responsibility. Enforce it in your domain layer using sessionId or transactionId before executing any side effect.
- Can moffhub/ussd automatically split long menus to fit USSD character limits?
- formatForNetwork() handles network-shaped plain-text reply serialization, but the supplied material does not confirm that it enforces the roughly 182-character aggregation budget or auto-splits long menus. Treat that as something to verify against real aggregator limits. Use the paginated list menu type for anything longer than a few short lines.
- How do I test a USSD flow locally without a telco aggregator?
- Point a feature test or HTTP client at your webhook route with a replayed provider payload; the generic fallback adapter lets you exercise flows without operator credentials. The package is Laravel-native, so standard HTTP tests and the one-route, one-controller setup make a two-level menu reproducible in a day. Note that no CI, coverage, or static analysis is published, so write your own test coverage rather than relying on the package's.
- Is moffhub/ussd production-ready and actively maintained?
- Treat the README as a specification, not as proof: the package has 1 star, 0 dependents, and effectively a single author, so there is no third-party production signal and no bus factor. The listed last release date (2026-10-25) post-dates any plausible review window, so verify the tag actually resolves and installs before designing around it. Ask about license and redistribution rights, who is on the hook for fixes, and whether paid support is offered.
- How do I add a custom USSD provider adapter that isn't Safaricom, Airtel, or MTN?
- The package exposes a provider registration hook alongside the built-in adapters for Safaricom/Africa's Talking, Airtel, MTN, and the generic fallback. Implement the adapter contract to normalize the operator's payload and let formatForNetwork() produce the reply shape. Then pin that provider explicitly on the route instead of relying on auto-detection.
- What are the alternatives to moffhub/ussd for building USSD apps in Laravel?
- There is no widely adopted Laravel USSD framework with clear third-party production signal in the supplied material; many teams build directly on an aggregator SDK such as Africa's Talking or handle raw payloads manually. The advantage of moffhub/ussd is bundled provider adapters, session management, and menu builders in one Laravel-native package. If you are on Laravel 10 or 11, a manual or lighter-weight approach also avoids a framework upgrade as a prerequisite.