A flexible and shipment tracking library for Yanwen Express(燕文物流).
Install via composer
$ composer require slince/shipment-tracking-yanwen-express
$tracker = new Slince\ShipmentTracking\YanWenExpress\YanWenTracker(KEY, 'en');
try {
$shipment = $tracker->track('CNAQV100168101');
if ($shipment->isDelivered()) {
echo "Delivered";
}
echo $shipment->getOrigin();
echo $shipment->getDestination();
print_r($shipment->getEvents()); //print the shipment events
} catch (Slince\ShipmentTracking\Exception\TrackException $exception) {
exit('Track error: ' . $exception->getMessage());
}
The MIT license. See MIT