Download the PHP package devrkb21/pathao-laravel without Composer
On this page you can find all versions of the php package devrkb21/pathao-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devrkb21/pathao-laravel
More information about devrkb21/pathao-laravel
Files in devrkb21/pathao-laravel
Package pathao-laravel
Short Description A complete Laravel package for Pathao Courier API integration with built-in validation, webhook handling, location caching, and Artisan commands.
License MIT
Homepage https://github.com/devrkb21/pathao-laravel
Informations about the package pathao-laravel
Pathao Laravel — Complete Laravel Package for Pathao Courier API
A complete Laravel package for Pathao Courier Merchant API integration. Setup once and forget about it — built-in validation, webhook handling, location caching, API logging, and powerful Artisan commands.
✨ Features
- ✅ Client Credentials authentication with automatic token refresh
- ✅ Sandbox & Production environment support
- ✅ Cities, Zones, Areas — with bulk endpoints & local database caching
- ✅ Store management (List & Create)
- ✅ Order management (Create, View, Bulk Create, Price Calculation)
- ✅ Merchant profile info retrieval
- ✅ User success rate by phone number
- ✅ Webhook signature validation with Laravel event dispatching
- ✅ API request & webhook logging to database
- ✅ Built-in request validation for all POST endpoints
- ✅ Artisan commands for setup, sync, status, and diagnostics
⚙️ Installation
Publish the config file:
Laravel auto-discovers the service provider. If needed, manually register:
Environment Variables
Add the following to your .env file:
Where to find credentials? Go to Pathao Developers API → Merchant API Credentials.
Setup
Run the migration:
Set up authentication (one-time process):
You will be provided a secret_token. Set it in your .env as PATHAO_SECRET_TOKEN.
🏗 Usage
Location APIs
Store APIs
Order APIs
Merchant & User APIs
🔧 Artisan Commands
| Command | Description |
|---|---|
pathao:setup |
Set up authentication credentials and generate secret token |
pathao:merchant-info |
Verify API connection and display merchant profile info |
pathao:sync-locations |
Fetch and cache all cities, zones, and areas into local database |
pathao:status |
Display connection config, token status, and cached location counts |
pathao:clear-cache |
Clear cached location tables |
🔔 Webhook Integration
The package automatically registers a webhook endpoint at:
Webhook Verification: To verify your webhook URL on Pathao's merchant dashboard, the package automatically captures the required challenge token UUID and echoes it back in the X-Pathao-Merchant-Webhook-Integration-Secret header. If necessary, you can manually set this UUID in your .env file as PATHAO_WEBHOOK_INTEGRATION_SECRET.
Signature Validation: Incoming requests are validated against X-Pathao-Signature header using your PATHAO_SECRET_TOKEN.
Event Dispatching: On valid webhook, the package dispatches a PathaoWebhookReceived event. Listen for it in your application:
Logging: All webhook calls (valid and invalid) are logged to the pathao_webhook_logs table. All API requests are logged to pathao_api_logs.
📦 Database Tables
After running migrations, the following tables are created:
| Table | Purpose |
|---|---|
pathao-courier (configurable) |
Stores access tokens and secret keys |
pathao_cities |
Cached cities directory |
pathao_zones |
Cached zones directory |
pathao_areas |
Cached areas directory |
pathao_api_logs |
API request/response history |
pathao_webhook_logs |
Webhook callback history |
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of pathao-laravel with dependencies
guzzlehttp/guzzle Version ^7.8
illuminate/contracts Version ^10.0|^11.0|^12.0