PHP code example of hopekelldev / laravel-danarewa

1. Go to this page and download the library: Download hopekelldev/laravel-danarewa 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/ */

    

hopekelldev / laravel-danarewa example snippets


use HopekellDev\DanArewa\Facades\DanArewa;

// Example: Verify NIN
$response = DanArewa::verifications()->ninVerification('12345678901');

if ($response && ($response['status'] ?? false) === 'success') {
    $data = $response['data'];
    // Process success
} else {
    $error = $response['message'] ?? 'Verification failed';
}

use HopekellDev\DanArewa\Facades\DanArewa; 

public function verifyNIN(Request $request)
{
    $response = DanArewa::verifications()->ninVerification($request->nin);

    return response()->json($response);
}
bash
php artisan vendor:publish --tag=config --provider="HopekellDev\DanArewa\DanArewaServiceProvider"
dotenv
DANAREWA_API_KEY=your_api_key_here
DANAREWA_BASE_URL=https://danarewatech.com.ng/api