hopekelldev / laravel-danarewa
Laravel wrapper for DanArewaTech API
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/hopekelldev/laravel-danarewa
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^10.0|^11.0
README
Laravel DanArewa is a Laravel 10+ package that provides a clean wrapper around the DanArewaTech identity verification API. It offers a Facade-based interface for verification, clearance, validation, and user wallet inquiries.
Requirements
- PHP >= 8.0
- Laravel >= 10.0
- GuzzleHTTP >= 7.0
Installation
Install the package via Composer:
composer require hopekelldev/laravel-danarewa
Configuration
Publish Configuration File
Run the following command to publish the configuration file:
php artisan vendor:publish --tag=config --provider="HopekellDev\DanArewa\DanArewaServiceProvider"
Environment Variables
Add the following to your .env file:
DANAREWA_API_KEY=your_api_key_here DANAREWA_BASE_URL=https://danarewatech.com.ng/api
Usage Example
Here’s how to use the package to verify an NIN:
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'; }
Available Methods
| Category | Method | Description | 
|---|---|---|
| Verifications | verifications()->ninVerification($nin) | Verify NIN by number | 
| Verifications | verifications()->phoneVerification($phone) | Verify NIN by registered phone | 
| Verifications | verifications()->bvnVerification($bvn) | Verify BVN number | 
| Verifications | verifications()->trackingIdVerification($trackingId) | Verify by Tracking ID | 
| IPE Clearance | ipeClearance()->ipeClearance($trackingID) | Instant IPE Clearance | 
| IPE Clearance | ipeClearance()->ipeClearanceStatus($trackingID) | Check IPE status | 
| Validation | validation()->validate($nin) | Validate ID | 
| Validation | validation()->validateStatus($nin) | Check validation status | 
| User Wallet | userDetails()->walletBalance() | Get user wallet balance | 
Controller Usage Example
Here’s an example of how to use the package in a Laravel controller:
use HopekellDev\DanArewa\Facades\DanArewa; public function verifyNIN(Request $request) { $response = DanArewa::verifications()->ninVerification($request->nin); return response()->json($response); }
License
This package is released under the MIT License.
Author
Ezenwa Hopekell
- GitHub: HopekellDev
- Email: hopekelltech@gmail.com
- Message Hopekell on Whatsapp
Contributions & Issues
Found a bug or have a feature request? Feel free to open an issue or submit a pull request on GitHub.