PHP code example of azmolla / fraud-checker-bd-courier-laravel

1. Go to this page and download the library: Download azmolla/fraud-checker-bd-courier-laravel 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/ */

    

azmolla / fraud-checker-bd-courier-laravel example snippets


use FraudCheckerBdCourier;

// Input a standard 11-digit Bangladeshi mobile number
$report = FraudCheckerBdCourier::check('01*********');

dump($report);

[
    'steadfast' => ['success' => 3, 'cancel' => 1, 'total' => 4, 'success_ratio' => 75.0],
    'pathao'    => ['success' => 5, 'cancel' => 2, 'total' => 7, 'success_ratio' => 71.43],
    'redx'      => ['success' => 20, 'cancel' => 5, 'total' => 25, 'success_ratio' => 80.0],
    'paperfly'  => ['success' => 0, 'cancel' => 0, 'total' => 1, 'success_ratio' => 0.0],
    'carrybee'  => ['success' => 10, 'cancel' => 0, 'total' => 10, 'success_ratio' => 100.0],

    // The summary across all supported couriers
    'aggregate' => [
        'total_success'    => 38,
        'total_cancel'     => 8,
        'total_deliveries' => 47,
        'success_ratio'    => 80.85,
        'cancel_ratio'     => 17.02
    ]
]

use Azmolla\FraudCheckerBdCourier\Services\PathaoService;
use Azmolla\FraudCheckerBdCourier\Services\SteadfastService;
use Azmolla\FraudCheckerBdCourier\Services\RedxService;
use Azmolla\FraudCheckerBdCourier\Services\PaperflyService;
use Azmolla\FraudCheckerBdCourier\Services\CarrybeeService;

$steadfastData = (new SteadfastService())->getDeliveryStats('01*********');
$redxData      = (new RedxService())->getDeliveryStats('01*********');
$pathaoData    = (new PathaoService())->getDeliveryStats('01*********');
$paperflyData  = (new PaperflyService())->getDeliveryStats('01*********');
$carrybeeData  = (new CarrybeeService())->getDeliveryStats('01*********');

use Azmolla\FraudCheckerBdCourier\Helpers\CourierDataValidator;

CourierDataValidator::checkBdMobile('01*********');
// Throws InvalidArgumentException if formatting fails
bash
php artisan vendor:publish --tag="config"