PHPackages                             eshanxbn/laravel-courier-hub-bd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. eshanxbn/laravel-courier-hub-bd

ActiveLibrary

eshanxbn/laravel-courier-hub-bd
===============================

Unified Bangladesh courier integration for Laravel — Pathao, Steadfast, RedX, eCourier, Paperfly. Single package, single config, easy enable/disable toggles.

028PHP

Since Jul 18Pushed 1mo agoCompare

[ Source](https://github.com/eshanxbn/laravel-courier-hub-bd)[ Packagist](https://packagist.org/packages/eshanxbn/laravel-courier-hub-bd)[ RSS](/packages/eshanxbn-laravel-courier-hub-bd/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

CourierHub
==========

[](#courierhub)

Unified Bangladesh courier integration for Laravel — Pathao, Steadfast, RedX, eCourier, Paperfly.

Why CourierHub?
---------------

[](#why-courierhub)

Most courier packages in Bangladesh support only a single courier, with completely different API methods, DTOs, and architectures.

CourierHub provides a unified `Manager/Driver` architecture (like Laravel's Cache or Filesystem) that normalizes **Order Booking**, **Tracking**, and **Webhooks** across the top 5 couriers in Bangladesh.

- ✅ **Switch couriers instantly**: `Courier::driver('pathao')->createOrder($data)`
- ✅ **Unified DTOs**: Same request/response objects for every courier
- ✅ **Normalized Webhooks**: A single event for all courier status updates

Installation
------------

[](#installation)

```
composer require eshanxbn/laravel-courier-hub-bd
```

If the package is not yet available on Packagist with a tagged release, install from GitHub:

```
composer config repositories.courierhub vcs https://github.com/eshanxbn/laravel-courier-hub-bd
composer require eshanxbn/laravel-courier-hub-bd:dev-main
```

Publish the config:

```
php artisan vendor:publish --tag="courierhub-config"
```

Configuration
-------------

[](#configuration)

Open `.env` and enable the couriers you want to use with their respective credentials.

```
COURIER_DEFAULT=pathao

COURIER_PATHAO_ENABLED=true
COURIER_PATHAO_CLIENT_ID="your_client_id"
COURIER_PATHAO_CLIENT_SECRET="your_secret"
COURIER_PATHAO_USERNAME="your_email@example.com"
COURIER_PATHAO_PASSWORD="your_password"
COURIER_PATHAO_STORE_ID="your_store_id"

COURIER_STEADFAST_ENABLED=true
COURIER_STEADFAST_API_KEY="your_api_key"
COURIER_STEADFAST_SECRET_KEY="your_secret"
```

Run health check:

```
php artisan courier:status
```

Usage
-----

[](#usage)

### Create an Order

[](#create-an-order)

```
use CourierHub\Facades\Courier;
use CourierHub\DTOs\OrderData;

$order = OrderData::from([
    'merchant_order_id' => 'INV-1001',
    'recipient_name'    => 'John Doe',
    'recipient_phone'   => '01712345678',
    'recipient_address' => 'Mirpur 10, Dhaka',
    'amount_to_collect' => 1250, // COD amount
    'weight'            => 1.5,
    // Optional Pathao / RedX location IDs
    'city_id'           => 1,
    'zone_id'           => 2,
    'area_id'           => 3,
    'store_id'          => 10,
]);

// Uses default driver
$response = Courier::createOrder($order);

// Or specify driver
$response = Courier::driver('steadfast')->createOrder($order);

echo $response->tracking_id; // Unified tracking ID
echo $response->status->value; // CourierHub\Enums\CourierStatus
```

### Tracking

[](#tracking)

```
$tracking = Courier::driver('pathao')->trackOrder('PATHAO-12345');
echo $tracking->current_status->value;
```

### Capability checks

[](#capability-checks)

```
if (Courier::supports('areas', 'pathao')) {
    $cities = Courier::driver('pathao')->getCities();
}
```

### Webhooks

[](#webhooks)

CourierHub provides a unified webhook endpoint: `POST /webhooks/courier/{provider}`.

Listen to the `CourierWebhookReceived` event in your application:

```
use CourierHub\Events\CourierWebhookReceived;

Event::listen(CourierWebhookReceived::class, function (CourierWebhookReceived $event) {
    $courier = $event->webhook->courier_name;
    $trackingId = $event->webhook->tracking_id;
    $merchantOrderId = $event->webhook->merchant_order_id;
    $status = $event->webhook->status; // CourierStatus Enum

    // Update your DB
});
```

License
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance60

Regular maintenance activity

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7fef1117de1deec10fb9652d3622e8b1e61bd438006cbb2200b275fc125b34d?d=identicon)[eshanxbn](/maintainers/eshanxbn)

---

Top Contributors

[![eshan-rul](https://avatars.githubusercontent.com/u/236746169?v=4)](https://github.com/eshan-rul "eshan-rul (3 commits)")[![eshanxbn](https://avatars.githubusercontent.com/u/38636425?v=4)](https://github.com/eshanxbn "eshanxbn (2 commits)")

### Embed Badge

![Health badge](/badges/eshanxbn-laravel-courier-hub-bd/health.svg)

```
[![Health](https://phpackages.com/badges/eshanxbn-laravel-courier-hub-bd/health.svg)](https://phpackages.com/packages/eshanxbn-laravel-courier-hub-bd)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
