PHPackages                             devmapr/laravel-shipping - 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. [API Development](/categories/api)
4. /
5. devmapr/laravel-shipping

ActiveLibrary[API Development](/categories/api)

devmapr/laravel-shipping
========================

Pluggable shipping manager for Laravel. Drivers: Alonomic, Tinex (Next One), SnappBox, and Forward.

v1.1.0(1mo ago)010↓50%MITPHPPHP &gt;=8.2CI passing

Since Jun 28Pushed 1mo agoCompare

[ Source](https://github.com/devmapr/laravel-shipping)[ Packagist](https://packagist.org/packages/devmapr/laravel-shipping)[ RSS](/packages/devmapr-laravel-shipping/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (10)Versions (3)Used By (0)

Laravel Shipping Manager
========================

[](#laravel-shipping-manager)

A pluggable, multi-driver shipping manager for Laravel.

 [![Latest Version](https://camo.githubusercontent.com/2988fe626cbc94c97696b851c3cc4d34fe20782f601debe1601b54dd632a85a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766d6170722f6c61726176656c2d7368697070696e67)](https://packagist.org/packages/devmapr/laravel-shipping) [![Total Downloads](https://camo.githubusercontent.com/a74fc71de12d0a891b161059467b08ba790841e7ffbbf46e5873d82c433c91b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766d6170722f6c61726176656c2d7368697070696e67)](https://packagist.org/packages/devmapr/laravel-shipping) [![License](https://camo.githubusercontent.com/48c84c0d6336e95f0d1a11f6edc98bfe2b0f93742b15b6cb0a489ad4f62ee7d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465766d6170722f6c61726176656c2d7368697070696e67)](https://packagist.org/packages/devmapr/laravel-shipping) [![GitHub Stars](https://camo.githubusercontent.com/cbb0d22c1f08457c3795df858ac36fc1dfb130450aa5dc29e293312c10b88cb2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6465766d6170722f6c61726176656c2d7368697070696e67)](https://github.com/devmapr/laravel-shipping)

---

Features
--------

[](#features)

- 🚚 **Multi-driver** — Switch between courier providers with zero code changes
- 🔌 **Pluggable** — Add custom drivers via a simple interface
- 📦 **Laravel Auto-Discovery** — Service provider and facade registered automatically
- 🕸 **Webhook Support** — Receive real-time delivery status updates (SnappBox)
- 🧪 **Easy to test** — Designed for testability and SOLID principles

Supported Drivers
-----------------

[](#supported-drivers)

DriverProviderTypeStatus**Alonomic**[Alopeyk](https://alopeyk.com)Courier API✅ Active**Tinex**[Next One](https://tinextco.com)Courier API✅ Active**SnappBox**SnappBoxCourier + Webhook✅ Active**Forward**ForwardCourier API✅ Active---

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

[](#installation)

```
composer require devmapr/laravel-shipping
```

> **Laravel Auto-Discovery** automatically registers the service provider and facade. No manual steps needed.

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

[](#configuration)

### 1. Publish the config file

[](#1-publish-the-config-file)

```
php artisan vendor:publish --tag=shipping-config
```

### 2. Set environment variables

[](#2-set-environment-variables)

Add the following to your `.env` file based on the drivers you need:

```
# ─── Default Driver ───────────────────────────────────
SHIPPING_DRIVER=tinex

# ─── Alonomic (Alopeyk) ───────────────────────────────
ALONOMIC_ACTIVE=true
ALONOMIC_EMAIL=your@email.com
ALONOMIC_PASSWORD=your-password

# ─── Tinex (Next One) ─────────────────────────────────
TINEX_ACTIVE=true
TINEX_USERNAME=your-username
TINEX_PASSWORD=your-password
TINEX_ORIGIN_CONTACT_ID=28
TINEX_DESTINATION_ID=4
TINEX_DEFAULT_PARCEL_SIZE_ID=3
TINEX_BARCODE_PREFIX=TINX_
TINEX_ORDER_NUMBER_PREFIX=ORD-

# ─── SnappBox ─────────────────────────────────────────
SNAPPBOX_ACTIVE=true
SNAPPBOX_API_BASE_URL=https://api.snappbox.com
SNAPPBOX_WEBHOOK_TOKEN=your-webhook-token

# ─── Forward ──────────────────────────────────────────
FORWARD_ACTIVE=true
FORWARD_USERNAME=your-username
FORWARD_PASSWORD=your-password
FORWARD_SENDER_PHONE=09120000000
FORWARD_SENDER_ADDRESS=Tehran, ...
FORWARD_SENDER_POSTAL_CODE=1234567890
```

---

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

```
use Planx\Shipping\Facades\Shipping;

// Resolve a driver by name
$shipping = Shipping::driver('tinex');

// Submit an order (driver-specific payload)
$result = $shipping->submit($order, [
    'parcel_size_id' => 3,
    'is_self_pickup' => true,
]);
```

### Tinex (Next One) — Parcel Size Options

[](#tinex-next-one--parcel-size-options)

```
$sizes = \Planx\Shipping\Drivers\TinexDriver::getSizeOptions();
// [1 => 'بسته سایز 1 (10×15×10)', 2 => 'بسته سایز 2 (15×20×10)', ...]
```

### SnappBox — Webhook Handling

[](#snappbox--webhook-handling)

SnappBox sends real-time delivery status updates to your server. All webhook logic is handled by `SnappBoxDriver::handleWebhook()`.

**Create a simple controller in your app:**

```
