PHPackages                             steadfast-courier/steadfast-courier-laravel-package - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. steadfast-courier/steadfast-courier-laravel-package

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

steadfast-courier/steadfast-courier-laravel-package
===================================================

A complate Laravel package for SteadFast Courier Limited

1.1.4(10mo ago)204.4k↑97.5%22[2 issues](https://github.com/steadfast-it/SteadFast-Courier-Laravel-Package/issues)MITPHPPHP ^7.2|^8.0

Since Mar 24Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/steadfast-it/SteadFast-Courier-Laravel-Package)[ Packagist](https://packagist.org/packages/steadfast-courier/steadfast-courier-laravel-package)[ Docs](https://github.com/steadfast-it/steadfast-courier-laravel-package)[ GitHub Sponsors](https://github.com/AmadulHaque)[ RSS](/packages/steadfast-courier-steadfast-courier-laravel-package/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (9)Versions (7)Used By (0)

 [![](https://raw.githubusercontent.com/steadfast-it/SteadFast-Courier-Laravel-Package/main/logo.png)](https://raw.githubusercontent.com/steadfast-it/SteadFast-Courier-Laravel-Package/main/logo.png)

A complate Laravel package for SteadFast Courier Limited
========================================================

[](#a-complate-laravel-package-for-steadfast-courier-limited)

[![](https://camo.githubusercontent.com/1b09df72d8b89f6ed484710f89279bc28bc6c20ce967ad9be9d2116c3ace467d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374656164666173742d69742f5374656164466173742d436f75726965722d4c61726176656c2d5061636b6167652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/1b09df72d8b89f6ed484710f89279bc28bc6c20ce967ad9be9d2116c3ace467d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374656164666173742d69742f5374656164466173742d436f75726965722d4c61726176656c2d5061636b6167652e7376673f7374796c653d666c61742d737175617265)[![](https://camo.githubusercontent.com/5febff88880f33dcd3c590c64edc3b2b3f23f1a2b880bbf7b8ebcf16fb0fe1a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7374656164666173742d69742f5374656164466173742d436f75726965722d4c61726176656c2d5061636b6167652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/5febff88880f33dcd3c590c64edc3b2b3f23f1a2b880bbf7b8ebcf16fb0fe1a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7374656164666173742d69742f5374656164466173742d436f75726965722d4c61726176656c2d5061636b6167652e7376673f7374796c653d666c61742d737175617265)

This is a Laravel/PHP package for [Steadfast](https://www.steadfast.com.bd/) Courier System. This package can be used in laravel projects. You can use this package for headless/rest implementation as well as blade or regular mode development. We created this package while working for a project and thought to made it release for all so that it helps. This package is available as regular php [composer package](https://packagist.org/packages/steadfast-it/SteadFast-Courier-Laravel-Package).

✨ Features
----------

[](#-features)

1. [Placing an order](https://github.com/steadfast-it/SteadFast-Courier-Laravel-Package#2-placing-an-order)
2. [Bulk Order Create](https://github.com/steadfast-it/SteadFast-Courier-Laravel-Package#3-bulk-order-create)
3. [Checking Delivery Status](https://github.com/steadfast-it/SteadFast-Courier-Laravel-Package#4-checking-deliverystatus)
4. [Checking Current Balance](https://github.com/steadfast-it/SteadFast-Courier-Laravel-Package#5-checking-current-balance)

🚀 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require steadfast-courier/steadfast-courier-laravel-package
```

You can publish the config file with:

```
php artisan vendor:publish --tag="steadfast-courier-config"
```

After publish config file setup your credential. you can see this in your config directory steadfast-courier.php file

```
 "base_url" => env('STEADFAST_BASE_URL', 'https://portal.steadfast.com.bd/api/v1'),
 "api_key" => env('STEADFAST_API_KEY', 'your-api-key'),
 "secret_key" => env('STEADFAST_SECRET_KEY', 'your-secret-key'),
 "webhook_bearer_token" => env('STEADFAST_BEARER_TOKEN', 'your-generated-token'),
```

### ⚙️ Set .env configuration

[](#️-set-env-configuration)

```
STEADFAST_BASE_URL= "https://portal.steadfast.com.bd/api/v1"
STEADFAST_API_KEY = "your-api-key"
STEADFAST_SECRET_KEY ="your-secret-key"
```

### 📬 1. Placing an order

[](#-1-placing-an-order)

`use SteadFast\SteadFastCourierLaravelPackage\Facades\SteadfastCourier;` Use this namespace at the top of the php class file

```
$orderData = [
    'invoice' => '123456',
    'recipient_name' => 'John Doe',
    'recipient_phone' => '01234567890',
    'recipient_address' => 'Fla# A1,House# 17/1, Road# 3/A, Dhanmondi,Dhaka-1209',
    'cod_amount' => 1000,
    'note' => 'Handle with care'
];

$response = SteadfastCourier::placeOrder($orderData);
```

#### Response:

[](#response)

```
{
    "status": 200,
    "message": "Consignment has been created successfully.",
    "consignment": {
        "consignment_id": 1424107,
        "invoice": "Aa12-das4",
        "tracking_code": "15BAEB8A",
        "recipient_name": "John Doe",
        "recipient_phone": "01234567890",
        "recipient_address": "Fla# A1,House# 17/1, Road# 3/A, Dhanmondi,Dhaka-1209",
        "cod_amount": 1000,
        "status": "in_review",
        "note": "Deliver within 3PM",
        "created_at": "2021-03-21T07:05:31.000000Z",
        "updated_at": "2021-03-21T07:05:31.000000Z"
    }
}
```

### 📦 2. Bulk Order Create

[](#-2-bulk-order-create)

`use  SteadFast\SteadFastCourierLaravelPackage\Facades\SteadfastCourier;` Use this is at the top of the php class file

```
$ordersData =
[
    [
        'invoice' => '123456',
        'recipient_name' => 'John Doe',
        'recipient_phone' => '01234567890',
        'recipient_address' => '123 Main St',
        'cod_amount' => 1000,
        'note' => 'Handle with care'
    ],[
        'invoice' => '789012',
        'recipient_name' => 'Jane Smith',
        'recipient_phone' => '09876543210',
        'recipient_address' => '456 Elm St',
        'cod_amount' => 1500,
        'note' => 'Fragile'
    ]
];

$response = SteadfastCourier::bulkCreateOrders($ordersData);
```

#### Response:

[](#response-1)

```
[
    {
        "invoice": "230822-1",
        "recipient_name": "John Doe",
        "recipient_address": "House 44, Road 2/A, Dhanmondi, Dhaka 1209",
        "recipient_phone": "0171111111",
        "cod_amount": "0.00",
        "note": null,
        "consignment_id": 11543968,
        "tracking_code": "B025A038",
        "status": "success"
    },
    {
        "invoice": "230822-1",
        "recipient_name": "John Doe",
        "recipient_address": "House 44, Road 2/A, Dhanmondi, Dhaka 1209",
        "recipient_phone": "0171111111",
        "cod_amount": "0.00",
        "note": null,
        "consignment_id": 11543969,
        "tracking_code": "B025A1DC",
        "status": "success"
    }
]
```

If there is any error in your data or network, the response will be like this.
------------------------------------------------------------------------------

[](#if-there-is-any-error-in-your-data-or-network-the-response-will-be-like-this)

#### Response:

[](#response-2)

```
[
    {
        "invoice": "230822-1",
        "recipient_name": "John Doe",
        "recipient_address": "House 44, Road 2/A, Dhanmondi, Dhaka 1209",
        "recipient_phone": "0171111111",
        "cod_amount": "0.00",
        "note": null,
        "consignment_id": null,
        "tracking_code": null,
        "status": "error"
    },
]
```

### 🔍 3. Checking Delivery Status

[](#-3-checking-delivery-status)

There are three way to check Delivery Status, and each have same response like below.

`use  SteadFast\SteadFastCourierLaravelPackage\Facades\SteadfastCourier;` Use this at the top of the php class file

```
// Way 1: Check Delivery Status using Consignment ID
$consignmentId = 123456;
$response1 = SteadfastCourier::checkDeliveryStatusByConsignmentId($consignmentId);

// Way 2: Check Delivery Status using Invoice ID
$invoice = "230822-1";
$response3 = SteadfastCourier::checkDeliveryStatusByInvoiceId($invoice);

// Way 3: Check Delivery Status using Tracking Code
$trackingCode = "B025A3FA";
$response2 = SteadfastCourier::checkDeliveryStatusByTrackingCode($trackingCode);
```

Response:

```
{
    "status": 200,
    "delivery_status": "in_review"
}
```

Delivery Statuses
-----------------

[](#delivery-statuses)

Here are the possible delivery statuses returned by the Steadfast Courier API along with their descriptions:

StatusMeaningpendingNot yet delivered or canceleddelivered\_approval\_pendingDelivered, awaiting admin approvalpartial\_delivered\_approval\_pendingPartially delivered, awaiting approvalcancelled\_approval\_pendingCancelled, awaiting approvalunknown\_approval\_pendingUnknown state, needs support interventiondeliveredDelivered and balance updatedpartial\_deliveredPartially delivered and balance updatedcancelledCancelled and balance updatedholdOn holdin\_reviewOrder placed, under reviewunknownUnknown status, Need contact with the support team```
[
    pending,
    delivered_approval_pending,
    partial_delivered_approval_pending,
    cancelled_approval_pending,
    unknown_approval_pending,
    delivered,
    partial_delivered,
    cancelled,
    hold,
    in_review,
    unknown
]
```

You can use these statuses to track the progress of your consignments and take appropriate actions.

### 💰 4. Checking Current Balance

[](#-4-checking-current-balance)

`use  SteadFast\SteadFastCourierLaravelPackage\Facades\SteadfastCourier;` Use this at the top of the php class file

```
$response = SteadfastCourier::getCurrentBalance();
```

#### Response:

[](#response-3)

```
{
    "status": 200,
    "current_balance": 0
}
```

### 🔁 5. Webhook Integration

[](#-5-webhook-integration)

SteadFast Webhook wants `Callback Url` and `Auth Token(Bearer)`

**Callback Url:** **SteadFast** will use this URL to announce any changes to the parcel status. **Auth Token(Bearer):** For Authentication.

#### Make a Api Route

[](#make-a-api-route)

```
Route::post('/staedfast-webhook', [SteadFastWebhookController::class, 'handleSteadFastWebhook']);
```

#### Set Auth Token(Bearer) in .env

[](#set-auth-tokenbearer-in-env)

```
STEADFAST_BEARER_TOKEN ="your-generated-bearer-token"
```

#### Controller: `SteadFastWebhookController` or your Own made Controller

[](#controller-steadfastwebhookcontroller-or-your-own-made-controller)

```
public function handleSteadFastWebhook(Request $request)
{
    $payload = $request->all();
    $token = $request->header('Authorization');

    // Check if Bearer token is valid
    if ($token !== 'Bearer '. config('steadfast-courier.webhook_bearer_token')) {
        return response()->json(['error' => 'Unauthorized'], 401);
    }

    try {
        $this->validatePayload($payload);
        $this->processPayload($payload);

        return response()->json(['status' => 'success'], 200);
    } catch (\Throwable $th) {
        return response()->json(['error' => $th->getMessage()], 400);
    }

    return response()->json(['message' => 'Webhook received'], 200);
}

private function validatePayload($payload)
{
    $properties = [
        'consignment_id',
        'invoice',
        'status',
        'cod_amount',
        'updated_at',
    ];
    $missingProperties = array_diff($properties, array_keys($payload));
    if ($missingProperties) {
        abort(400, 'Missing required properties: ' . implode(', ', $missingProperties));
    }
}

private function processPayload($payload)
{
    $consignment_id = $payload['consignment_id'];
    $orderStatus = $payload['status'];

    /**
    *| WRITE YOUR CODE
    *| FOR HANDLE THE COURIER STATUS
    *| OF YOUR APPLICATION
    */
}
```

### 6. Using Custom Config

[](#6-using-custom-config)

If you don’t want to rely on .env or you’re building a SaaS application with multiple Steadfast Courier integrations, you can provide custom configuration using the withConfig method:

```
use SteadFast\SteadFastCourierLaravelPackage\Facades\SteadfastCourier;

// Set custom API credentials and optional base URL
$response = SteadfastCourier::withConfig(
    'your_api_key',          // API Key
    'your_secret_key',       // API Secret
    'optional_base_url'      // Optional: custom base URL
)->getCurrentBalance();
```

📞 Support
---------

[](#-support)

For any issues or questions related to this package, please open an issue on GitHub.

👥 Credits
---------

[](#-credits)

- [AmadulHaque](https://github.com/AmadulHaque)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance54

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.2% 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.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~126 days

Total

6

Last Release

324d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4382d98bd5f19c0102afe347bed59fab442e125d644ec0feb603d1b5f5aec1d5?d=identicon)[steadfastcourier](/maintainers/steadfastcourier)

---

Top Contributors

[![AmadulHaque](https://avatars.githubusercontent.com/u/92516695?v=4)](https://github.com/AmadulHaque "AmadulHaque (16 commits)")[![steadfast-it](https://avatars.githubusercontent.com/u/162102032?v=4)](https://github.com/steadfast-it "steadfast-it (6 commits)")[![rajibbinalam](https://avatars.githubusercontent.com/u/41984925?v=4)](https://github.com/rajibbinalam "rajibbinalam (2 commits)")[![abdulmajidcse](https://avatars.githubusercontent.com/u/43958759?v=4)](https://github.com/abdulmajidcse "abdulmajidcse (2 commits)")[![meraz-hossain](https://avatars.githubusercontent.com/u/218753330?v=4)](https://github.com/meraz-hossain "meraz-hossain (1 commits)")[![t-a-zihad](https://avatars.githubusercontent.com/u/61927505?v=4)](https://github.com/t-a-zihad "t-a-zihad (1 commits)")[![UtsabDey](https://avatars.githubusercontent.com/u/44144515?v=4)](https://github.com/UtsabDey "UtsabDey (1 commits)")

---

Tags

laravelSteadFaststeadfast-courier-laravel-package

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/steadfast-courier-steadfast-courier-laravel-package/health.svg)

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

###  Alternatives

[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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