PHP code example of mohamedhekal / shipbridge-turbo

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

    

mohamedhekal / shipbridge-turbo example snippets


use Hekal\ShipBridge\Facades\ShipBridge;
use Hekal\ShipBridge\DTOs\Address;
use Hekal\ShipBridge\DTOs\CreateShipmentRequest;
use Hekal\ShipBridge\DTOs\Parcel;

$shipment = ShipBridge::driver('turbo')->createShipment(new CreateShipmentRequest(
    origin: new Address('المخزن', 'شارع ١', 'القاهرة', 'EG', phone: '01011111111'),
    destination: new Address('العميل', 'شارع النيل', 'الجيزة', 'EG', phone: '01000000000'),
    parcels: [new Parcel(weightKg: 1.2, description: 'ملابس')],
    reference: 'ORD-42',
    metadata: [
        'cod' => 250,
        'government' => 'الجيزة',
        'area' => 'الدقي',
    ],
));

echo $shipment->trackingNumber; // bar_code

ShipBridge::driver('turbo')->track($shipment->trackingNumber);
ShipBridge::driver('turbo')->label($shipment->trackingNumber); // رابط التتبع العام

ShipBridge::driver('turbo')->createShipment(...); // POST /add-order
ShipBridge::driver('turbo')->track('BARCODE');    // /get-status → /search-order
ShipBridge::driver('turbo')->label('BARCODE');    // public tracking URL