matyo-17/lalamove
最新稳定版本:v1.0.1
Composer 安装命令:
composer require matyo-17/lalamove
包简介
Lalamove SDK
README 文档
README
PHP SDK for Lalamove API
Minimum Requirements
Installation
composer require matyo-17/lalamove
Examples
require __DIR__.'/vendor/autoload.php'; use Carbon\Carbon; use Matyo17\Lalamove\Lalamove; use Matyo17\Lalamove\Coordinates; use Matyo17\Lalamove\DeliveryDetails; use Matyo17\Lalamove\DeliveryStops; use Matyo17\Lalamove\Enums\Services; // Initialise $lalamove = new Lalamove( api_key: 'api_key', api_secret: 'api_secret', sandbox: false, market: 'MY' ); // Make a quotation $from = new DeliveryStops( coordinates: Coordinates::fromString("3.1427780826742193, 101.70046857079332"), address: "Warisan Merdeka Tower, Precinct, Kuala Lumpur City Centre, 50118 Kuala Lumpur, Federal Territory of Kuala Lumpur" ); $to = new DeliveryStops( coordinates: Coordinates::fromString("3.1578402961856846, 101.71218381851456"), address: "Petronas Twin Tower, Kuala Lumpur City Centre, 50088 Kuala Lumpur, Federal Territory of Kuala Lumpur" ); $quotation = $lalamove->makeQuotation(Services::CAR, [$from, $to], Carbon::now()->addHours()); // place an order $sender = new DeliveryDetails( stop_id: $quotation['stops'][0]['stopId'], name: "Sender", phone: "+60123456789" ); $receiver = new DeliveryDetails( stop_id: $quotation['stops'][1]['stopId'], name: "Receiver", phone: "+60123456789", ); $order = $lalamove->placeOrder($quotation['quotationId'], $sender, [$receiver], true); // get order details $order_details = $lalamove->getOrder($order['orderId']); // add priority fee $priority_fee = $lalamove->addPriorityFee($order['orderId'], "10.00"); // get city info $cities = $lalamove->getCityInfo(); // add webhook $webhook = $lalamove->setWebhook("https://webhook.site/32e3c3d7-2175-4c4a-87d3-cd0c84a2bb5d");
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-07