PHP code example of yohacodes / afro-msg-php

1. Go to this page and download the library: Download yohacodes/afro-msg-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yohacodes / afro-msg-php example snippets


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

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.";
}

namespace AfroMsg\Contracts;

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

use AfroMsg\Facades\AfroMsg;

AfroMsg::verifyCode('0912345678', '4567');
bash
php artisan vendor:publish --provider="AfroMsg\AfromessageServiceProvider"