Simple Parcel Tracker Packagist for Local Parcel Courier. Basically it just crawl the courier website. Need time to time monitor changes before failure happend.
Pftt.. I just dont know why, the Travis CI is failed. It because of gnutls_handshake() failed
. In my local env, all test passed =)
- Currently just only POSTLAJU, GDEX, ABXExpress
Tested in PHP 7.1
composer require afiqiqmal/parcel-track
Alternatively, you can specify as a dependency in your project's existing composer.json file
{
"require": {
"afiqiqmal/parcel-tracker": "^1.0"
}
}
After installing, you need to require Composer's autoloader and add your code.
require_once __DIR__ .'/../vendor/autoload.php';
$data = parcel_track()
->postLaju()
->setTrackingNumber("ER157080065MY")
->fetch();
$data = parcel_track()
->gdex()
->setTrackingNumber("4941410530")
->fetch();
$data = parcel_track()
->abxExpress()
->setTrackingNumber("EZP843055940197")
->fetch();
Method | Param | Description |
---|---|---|
postLaju() | Post Laju Courier | |
abxExpress() | Post Laju Courier | |
gdex() | GD Express Courier | |
setTrackingNumber($refNumber) | String |
Enter the tracking number |
You should getting data similarly like below:
{
"code": 200,
"error": false,
"tracker": [
{
"date": "2018-02-05 16:24:20",
"timestamp": 1517847860,
"process": "Item posted over the counter",
"type": "item_received",
"event": "Pos Laju Temerloh"
},
{
"date": "2018-02-05 22:01:57",
"timestamp": 1517868117,
"process": "Item dispatched out",
"type": "dispatch",
"event": "Pos Laju Temerloh"
},
{
"date": "2018-02-06 03:44:45",
"timestamp": 1517888685,
"process": "Consignment dispatch out from Transit Office",
"type": "dispatch",
"event": "Pos Laju Transit Office"
},
{
"date": "2018-02-07 12:20:25",
"timestamp": 1518006025,
"process": "Arrive at delivery facility at",
"type": "arrived_facility",
"event": "Pos Laju Keningau"
},
{
"date": "2018-02-08 07:44:49",
"timestamp": 1518075889,
"process": "Arrive at delivery facility at",
"type": "arrived_facility",
"event": "Pos Laju Keningau"
},
{
"date": "2018-02-08 07:51:36",
"timestamp": 1518076296,
"process": "Item out for delivery",
"type": "out_for_delivery",
"event": "Pos Laju Keningau"
},
{
"date": "2018-02-08 14:01:24",
"timestamp": 1518098484,
"process": "Item delivered to HASMIN",
"type": "delivered",
"event": "Pos Laju Keningau"
}
],
"footer": {
"source": "Post Laju",
"developer": {
"name": "Hafiq",
"homepage": "https:\/\/github.com\/afiqiqmal"
}
}
}
- Struggling for other Parcel Data
Licensed under the MIT license