1. Go to this page and download the library: Download devrkb21/pathao-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Get all cities
PathaoLaravel::GET_CITIES();
// Get zones for a city
PathaoLaravel::GET_ZONES(int $city_id);
// Get areas for a zone
PathaoLaravel::GET_AREAS(int $zone_id);
// Bulk fetch all zones / areas
PathaoLaravel::GET_ZONES_BULK();
PathaoLaravel::GET_AREAS_BULK();
// List stores (with optional pagination)
PathaoLaravel::GET_STORES(int $page = 1);
// Create a new store
// Required: name, contact_name, contact_number, address, city_id, zone_id, area_id
PathaoLaravel::CREATE_STORE($request);
// Get merchant profile info
PathaoLaravel::GET_MERCHANT_INFO();
// Get user success rate by phone
PathaoLaravel::GET_USER_SUCCESS_RATE($request);
// Check token expiry
PathaoLaravel::GET_ACCESS_TOKEN_EXPIRY_DAYS_LEFT();
use devrkb21\PathaoLaravel\Events\PathaoWebhookReceived;
Event::listen(PathaoWebhookReceived::class, function ($event) {
$payload = $event->payload;
// Map webhook data to your order status updates
// $payload['event'], $payload['consignment_id'], $payload['order_status'], etc.
});