PHP code example of libaro / shipmenttracker

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

    

libaro / shipmenttracker example snippets


return [
    'providers' => [
        [
            'name' => 'bpost',
            'label' => 'BPost',
            'adapter' => \Libaro\ShipmentTracker\Adapters\BPostAdapter::class,
            'barcode_tags' => [3232],
            'credentials' => [
                'username' => env('SHIPMENT_TRACKER_BPOST_USERNAME'),
                'password' => env('SHIPMENT_TRACKER_BPOST_PASSWORD'),
            ],
        ],
        [
            'name' => 'post_nl',
            'label' => 'PostNL',
            'adapter' => \Libaro\ShipmentTracker\Adapters\PostNLAdapter::class,
            'barcode_tags' => ['3S', 'CD'],
            'credentials' => [
            ],
        ],
        [
            'name' => 'dhl',
            'label' => 'DHL',
            'adapter' => \Libaro\ShipmentTracker\Adapters\DhlAdapter::class,
            'barcode_tags' => [],
            'credentials' => [
                'api_key' => env('SHIPMENT_TRACKER_DHL_API_KEY'),
                'api_secret' => env('SHIPMENT_TRACKER_DHL_API_SECRET')
            ],
        ],
    ],
];

Shipment::track('5995390550944994')
bash
php artisan vendor:publish --tag="shipment-tracker"