PHPackages                             yohacodes/afro-msg-php - 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. yohacodes/afro-msg-php

ActiveLibrary[API Development](/categories/api)

yohacodes/afro-msg-php
======================

A modern, PSR-compliant PHP SDK for easily integrating with the Afromessage API. Includes support for verification, messaging, and more.

v0.0.1(1y ago)30MITPHPPHP ^7.4 || ^8.0CI passing

Since May 30Pushed 1y agoCompare

[ Source](https://github.com/yohacode/afro-msg-php)[ Packagist](https://packagist.org/packages/yohacodes/afro-msg-php)[ RSS](/packages/yohacodes-afro-msg-php/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

AfroMsg - PHP SDK for Afromessage API
=====================================

[](#afromsg---php-sdk-for-afromessage-api)

[![Latest Version](https://camo.githubusercontent.com/1f7b9d0a2b92a587bfc87290b7f11066339eed4c8c305a0ffceab096fb99fd88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796f6861636f6465732f6166726f2d6d73672d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yohacode/afromsg)[![Build Status](https://github.com/yohaqr/yohaqr/actions/workflows/php.yml/badge.svg)](https://github.com/yohacode/afromsg/actions/workflows/php.yml)

**AfroMsg** is a modern, extensible PHP SDK for integrating with the [Afromessage API](https://api.afromessage.com/). It supports token-based authentication, code verification, message sending, and is fully PSR-compliant. Ideal for Laravel and any PHP-based backend.

---

🚀 Features
----------

[](#-features)

- ✅ Clean and simple API for SMS verification and messaging
- ✅ PSR-4 &amp; PSR-12 compliant structure
- ✅ Laravel-ready (via optional ServiceProvider)
- ✅ Extensible via interfaces (use Guzzle, Curl, or any HTTP client)
- ✅ Fully tested with PHPUnit
- ✅ IDE-friendly with stubs and PHPDocs

---

📦 Installation
--------------

[](#-installation)

Install the SDK using Composer:

```
composer require yohacodes/afro-msg-php
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Create a `.env` file or define your token manually:

```
AFROMESSAGE_API_TOKEN=your_api_token
```

Alternatively, configure directly in code:

```
$client = new \AfroMsg\Http\GuzzleAfromessageClient('your_api_token');
```

---

✨ Quick Start
-------------

[](#-quick-start)

### 🔍 Verify Code

[](#-verify-code)

```
use AfroMsg\Http\GuzzleAfromessageClient;

$client = new GuzzleAfromessageClient('your_api_token');

$response = $client->verifyCode('+251912345678', '123456');

if ($response['success']) {
    echo "Code verified!";
} else {
    echo "Verification failed.";
}
```

---

🧱 Architecture
--------------

[](#-architecture)

```
AfroMsg\
├── Contracts\            # Interfaces for HTTP clients
├── Http\                 # Guzzle implementation (default)
├── Responses\            # Response wrappers
├── Exceptions\           # Custom exception classes
├── Support\              # Helper utilities
├── AfroMsg.php           # Facade for simplified usage
└── stubs\                # IDE stubs and config templates

```

---

🧪 Testing
---------

[](#-testing)

Run all unit and feature tests using:

```
vendor/bin/phpunit
```

We recommend using `Mockery` and `Guzzle MockHandler` for mocking API calls.

---

🧩 Extending
-----------

[](#-extending)

Create a custom client by implementing the interface:

```
namespace AfroMsg\Contracts;

interface AfromessageClientInterface
{
    public function verifyCode(string $to, string $code): array;
}
```

You can then inject or bind your implementation as needed.

---

🎯 Laravel Integration (Optional)
--------------------------------

[](#-laravel-integration-optional)

For Laravel users, a service provider and config file can be published:

```
php artisan vendor:publish --provider="AfroMsg\AfromessageServiceProvider"
```

```
use AfroMsg\Facades\AfroMsg;

AfroMsg::verifyCode('0912345678', '4567');
```

---

🧠 Roadmap
---------

[](#-roadmap)

- Basic verify functionality
- SMS sending
- Delivery reports
- Balance check
- Notifications and webhooks
- Laravel package auto-discovery

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome!

1. Fork the repo
2. Run `composer install`
3. Create your feature branch (`git checkout -b feature/my-feature`)
4. Commit your changes
5. Push to the branch
6. Create a new Pull Request

---

🛡 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

---

📞 Contact &amp; Support
-----------------------

[](#-contact--support)

For questions or support, please open an [issue](https://github.com/yohacode/afromsg/issues) or email `support@yourdomain.com`.

---

> Crafted with ❤️ by Yohannes Z. ()

```

---

### ✅ Next Steps

If you'd like, I can:
- Generate this as a full GitHub-ready package
- Scaffold the full project structure as a `.zip`
- Add CI workflow (`.github/workflows/tests.yml`)
- Create Packagist metadata

Would you like the full structure generated?

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance47

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

400d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/72225779?v=4)[Yohannes Zerihun](/maintainers/yohacode)[@yohacode](https://github.com/yohacode)

---

Top Contributors

[![yohacode](https://avatars.githubusercontent.com/u/72225779?v=4)](https://github.com/yohacode "yohacode (31 commits)")

---

Tags

apismsmessagingphp-sdkverificationafromessage

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yohacodes-afro-msg-php/health.svg)

```
[![Health](https://phpackages.com/badges/yohacodes-afro-msg-php/health.svg)](https://phpackages.com/packages/yohacodes-afro-msg-php)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M45](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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