PHP code example of nguyendachuy / laravel-delhivery-api

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

    

nguyendachuy / laravel-delhivery-api example snippets


return [
    /*
    |--------------------------------------------------------------------------
    | Delhivery Mode
    |--------------------------------------------------------------------------
    |
    | Here you can set the mode for delhivery. (staging or live)
    | default is staging
    */

    'mode' => env('DELHIVERY_MODE', 'staging'),


    /*
    |--------------------------------------------------------------------------
    | Delhivery Token
    |--------------------------------------------------------------------------
    |
    | Here you can set the token delhivery.
    | 
    */

    'token' => env('DELHIVERY_TOKEN', null),


    /*
    |--------------------------------------------------------------------------
    | Default output response type
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the output response you need.
    | 
    | Supported: "collection" , "object", "array"
    | 
    */

    'responseType' => env('DELHIVERY_RESPONSE_TYPE', 'collection'),
];


    $response =  Delhivery::pincode()->getLocations([
        'filter_codes' => 400064
    ]);



    $response =  Delhivery::waybill()->bulk([
        'count' => 5
    ]);



    $response =  Delhivery::waybill()->fetch([
        'client_name' => ''
    ]);


$orderDetails = [
    // refer above url for n' => [...],
];
    $response =  Delhivery::order()->create($orderDetails);

   
$orderDetails = [
    // refer above url for _width' => 10,
    'product_details' => '',
    'add' => ''
];
$response =  Delhivery::order($token)->edit($orderDetails);

$waybill = 'waybill no'; 
$response =  Delhivery::order()->cancel(['waybill' => $waybill]);

$waybill = 'waybill no'; 
$response =  Delhivery::order()->track(['waybill' => $waybill]);

$response =  Delhivery::invoice()->getLocations([]);

$response =  Delhivery::packingSlip()->print($waybill);

$response =  Delhivery::pickup()->request([]);

$response =  Delhivery::warehouse()->create([]);

$response =  Delhivery::warehouse()->edit([]);

$response =  Delhivery::ndr()->update([]);

$response =  Delhivery::ndr()->get($upl);
bash
php artisan vendor:publish --provider="NguyenHuy\Delhivery\DelhiveryServiceProvider" --tag="config"