enan/pathao-courier
Composer 安装命令:
composer require enan/pathao-courier
包简介
A complete Laravel package for Pathao Courier
README 文档
README
A complete Laravel Package for Pathao Courier
A complete package for Laravel to use Pathao Courier Merchant API. Setup once and forget about it. You don’t even have to worry about the validation of creating orders, creating a store, or getting calculated price value which are generally a POST request on the Pathao courier end.
With this package you can get the following
- Get the city list
- Get the zone list
- Get the area list
- Get the store list
- Create Store
- Get order details
- Get calculated price
- Get the token exipiration days left and also expected date of it
- Get the user success rate using phone number
It offers you a bunch of validation for Create order, Create Store, Get calculated price.So you don't have to worry about the validation for all of this.
⚙️ Installation
You can install the package via composer:
composer require enan/pathao-courier
You can publish the migration file and config file with:
php artisan vendor:publish --tag="pathao-courier-config"
Though Laravel auto discover. If not add the following in config\app.php. You can skip this part if you want.
// add below line in the providers array Enan\PathaoCourier\PathaoCourierServiceProvider::class, // add below line in the alias array 'PathaoCourier' => Enan\PathaoCourier\Facades\PathaoCourier::class,
Add the following environment variables to your
.envfile. You can choose the table name of migration before running the migration. Default is 'pathao-courier'
PATHAO_DB_TABLE_NAME='pathao-courier'
PATHAO_CLIENT_ID=
PATHAO_CLIENT_SECRET=
PATHAO_SECRET_TOKEN=
🔑 Where can I find the value?
Go to your Pathao Developers Api and you'll find Merchant API Credentials there.
And for PATHAO_SECRET_TOKEN= you'll be provided it after the successfull authentication.
🎫 Setup
Run the migration
php artisan migrate
You have to set the token of pathao courier. To set run below artisan command
The command will ask the credentials. This is a one time process. You don't have to setup this again.
If you want to update current token and secret you can run the command again.
You will be provided a secret token here. Please set the token in your .env file with PATHAO_SECRET_TOKEN=
php artisan set:pathao-courier
🏗 Usage
Add the Facade before using
use Enan\PathaoCourier\Facades\PathaoCourier;
For the POST type response the required validation are mentioned before the function like <required, string> So here the value should be required and string
/** * To Get the days left of token expiration * You'll get the expected date of the expiration and total days left * * @type <GET> */ PathaoCourier::GET_ACCESS_TOKEN_EXPIRY_DAYS_LEFT(); /** * To Get the cities * * @type <GET> */ PathaoCourier::GET_CITIES(); /** * To Get the Zones * @type <GET> * * @param int $city_id */ PathaoCourier::GET_ZONES(int $city_id); /** * To Get the Areas * @type <GET> * * @param int $zone_id */ PathaoCourier::GET_AREAS(int $zone_id); /** * To Get the Stores * @type <GET> * * @param int $page * $page param is optional. If you want you can implement pagination here. */ PathaoCourier::GET_STORES(int $page); /** * To Create Store * @type <POST> * Pass below mentioned parameter * * @param $name <required, string> * @param $contact_name <required, string> * @param $contact_number <required, numeric> * @param $address <required, string> * @param $city_id <required, numeric> * @param $zone_id <required, numeric> * @param $area_id <required, numeric> */ PathaoCourier::CREATE_STORE($request); /** * To Create Order * @type <POST> * Pass below mentioned parameter * * @param $store_id <required, numeric> * @param $merchant_order_id <nullable, string> * @param $sender_name <required, numeric> * @param $sender_phone <required, string/> * @param $recipient_name <required, string> * @param $recipient_phone <required, string> * @param $recipient_address <required, string, Min:10> * @param $recipient_city <required, numeric> * @param $recipient_zone <required, numeric> * @param $recipient_area <required, numeric> * @param $delivery_type <required, numeric> is provided by the merchant and not changeable. 48 for Normal Delivery, 12 for On Demand Delivery" * @param $item_type <required, numeric> is provided by the merchant and not changeable. 1 for Document, 2 for Parcel" * @param $special_instruction <nullable, string> * @param $item_quantity <required, numeric> * @param $item_weight <required, numeric> * @param $amount_to_collect <required, numeric> * @param $item_description <nullable, string> */ PathaoCourier::CREATE_ORDER($request); /** * To Get Price Calculation * @type <POST> * Pass below mentioned parameter * * @param $delivery_type <required, numeric> * @param $item_type <required, numeric> * @param $item_weight <required, numeric> * @param $recipient_city <required, numeric> * @param $recipient_zone <required, numeric> * @param $store_id <required, numeric> */ PathaoCourier::GET_PRICE_CALCULATION($request); /** * To View Order * @type <GET> * @param string $consignment_id */ PathaoCourier::VIEW_ORDER(string $consignment_id); /** * To Get User's success rate using phone number * @type <POST> * @param string $phone */ PathaoCourier::GET_USER_SUCCESS_RATE($request);
Credits
License
The MIT License (MIT). Please see License File for more information.
Check me on
enan/pathao-courier 适用场景与选型建议
enan/pathao-courier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 697 次下载、GitHub Stars 达 15, 最近一次更新时间为 2023 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「Moammer Farshid Enan」 「pathao-courier」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 enan/pathao-courier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 enan/pathao-courier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 enan/pathao-courier 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A complete Laravel package for Pathao Courier for nepal fork of enan/pathao-courier
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
统计信息
- 总下载量: 697
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-14