PHPackages                             susheelbhai/laraship - 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. susheelbhai/laraship

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

susheelbhai/laraship
====================

Multi-provider shipping integration for Laravel e-commerce applications

v2.1.1(2mo ago)029MITPHPPHP ^8.2

Since Oct 3Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/susheelbhai/laraship)[ Packagist](https://packagist.org/packages/susheelbhai/laraship)[ RSS](/packages/susheelbhai-laraship/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (15)Used By (0)

Laraship - Laravel Multi-Provider Shipping Integration
======================================================

[](#laraship---laravel-multi-provider-shipping-integration)

A comprehensive Laravel package for integrating multiple shipping providers with full CRUD UI and order integration.

Features
--------

[](#features)

- 25 shipping provider adapters (Indian and International)
- Pickup address management per provider (API-based, no .env required)
- Rate calculation and comparison
- Automated shipment booking
- Real-time tracking
- Webhook support for status updates
- Admin UI for provider management
- User-facing tracking interface
- Queue support for async operations
- Event-driven architecture

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

[](#installation)

### Quick Install (Recommended - Automated)

[](#quick-install-recommended---automated)

The package includes an **automated installer** that handles all file modifications:

```
# Install package
composer require susheelbhai/laraship

# Run automated installer
php artisan laraship:install

# Build frontend assets
npm run build

# Clear caches
php artisan optimize:clear
```

The installer will:

- ✅ Publish all assets (config, migrations, controllers, routes, components)
- ✅ Run migrations and seeders
- ✅ Automatically modify 12 project files
- ✅ Prompt you to confirm each change

**See [AUTOMATED\_INSTALLATION.md](AUTOMATED_INSTALLATION.md) for complete automated installation guide.**

### Manual Installation

[](#manual-installation)

If you prefer manual control, see the sections below.

Publishing Assets
-----------------

[](#publishing-assets)

### 1. Publish Configuration

[](#1-publish-configuration)

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

### 2. Publish Migrations

[](#2-publish-migrations)

```
php artisan vendor:publish --tag=laraship-migrations
php artisan migrate
```

### 3. Publish Controllers

[](#3-publish-controllers)

```
php artisan vendor:publish --tag=laraship-controllers
```

This publishes:

- `app/Http/Controllers/Admin/ShippingProviderController.php`
- `app/Http/Controllers/Admin/OrderShipmentController.php`

### 4. Publish Form Requests

[](#4-publish-form-requests)

```
php artisan vendor:publish --tag=laraship-requests
```

This publishes:

- `app/Http/Requests/ShippingProviderRequest.php`

### 5. Publish React Components

[](#5-publish-react-components)

```
php artisan vendor:publish --tag=laraship-components
```

This publishes:

- Admin CRUD pages: `resources/js/pages/admin/resources/shipping_provider/`
- Shipping components: `resources/js/components/shipping/`

### 6. Publish Routes

[](#6-publish-routes)

#### Admin Routes

[](#admin-routes)

```
php artisan vendor:publish --tag=laraship-routes
```

This publishes `routes/admin/laraship.php`

Include in your `routes/web.php`:

```
Route::middleware(['auth:admin'])->prefix('admin')->name('admin.')->group(function () {
    require __DIR__.'/admin/laraship.php';
});
```

#### User Routes

[](#user-routes)

```
php artisan vendor:publish --tag=laraship-user-routes
```

This publishes `routes/user/laraship.php`

Include in your `routes/user/web.php`:

```
Route::middleware(['auth'])->group(function () {
    require __DIR__.'/laraship.php';
});
```

#### Webhook Routes (Public)

[](#webhook-routes-public)

```
php artisan vendor:publish --tag=laraship-webhook-routes
```

This publishes `routes/admin/laraship_webhook.php`

Include in your `routes/web.php`:

```
// Webhook routes (PUBLIC - NO AUTHENTICATION REQUIRED)
// ⚠️ CRITICAL: Do NOT put behind auth middleware!
// Shipping providers need direct access to send webhooks
require __DIR__.'/admin/laraship_webhook.php';
```

**⚠️ IMPORTANT:** Webhook routes MUST be publicly accessible. Shipping providers (Delhivery, FedEx, etc.) cannot authenticate to your application. If you put these routes behind authentication, webhooks will fail.

Security is handled through:

- Signature verification (cryptographic signatures)
- Rate limiting (60 requests/minute)
- Webhook logging (audit trail)

#### Publish All Routes at Once

[](#publish-all-routes-at-once)

```
php artisan vendor:publish --tag=laraship-routes --tag=laraship-user-routes --tag=laraship-webhook-routes
```

### 7. Publish Seeders (Optional)

[](#7-publish-seeders-optional)

```
php artisan vendor:publish --tag=laraship-seeders
```

### 8. Publish Notifications (Optional)

[](#8-publish-notifications-optional)

```
php artisan vendor:publish --tag=laraship-notifications
```

This publishes notification classes to `app/Notifications/Laraship/` for customization.

See [NOTIFICATION\_CUSTOMIZATION\_GUIDE.md](NOTIFICATION_CUSTOMIZATION_GUIDE.md) for details.

### Quick Install (All at once)

[](#quick-install-all-at-once)

```
php artisan laraship:install
```

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

[](#configuration)

### Environment Variables

[](#environment-variables)

```
LARASHIP_WAREHOUSE_NAME="Your Warehouse"
LARASHIP_WAREHOUSE_PHONE="1234567890"
LARASHIP_WAREHOUSE_ADDRESS="123 Main St"
LARASHIP_WAREHOUSE_CITY="City"
LARASHIP_WAREHOUSE_STATE="State"
LARASHIP_WAREHOUSE_PINCODE="110001"
```

### Model Setup

[](#model-setup)

Add traits to your models:

**Product Model:**

```
use Susheelbhai\Laraship\Traits\HasShippingDimensions;

class Product extends Model
{
    use HasShippingDimensions;
}
```

**Order Model:**

```
use Susheelbhai\Laraship\Traits\HasShipment;

class Order extends Model
{
    use HasShipment;
}
```

Supported Providers
-------------------

[](#supported-providers)

### Indian Providers (21)

[](#indian-providers-21)

1. Mock Provider (Testing)
2. Delhivery
3. DTDC
4. Bluedart
5. Shiprocket
6. India Post
7. Ecom Express
8. Xpressbees
9. Shadowfax
10. Dunzo
11. Ekart (Flipkart)
12. Amazon Transport
13. Gati
14. Shyplite
15. Pickrr
16. iThink Logistics
17. Vamaship
18. Professional Couriers
19. Trackon
20. VRL Logistics
21. TCI Express

### International Providers (4)

[](#international-providers-4)

22. FedEx
23. DHL
24. Aramex
25. UPS

Usage
-----

[](#usage)

### Wallet Management

[](#wallet-management)

For detailed information on checking balances and recharging wallets, see [WALLET\_MANAGEMENT.md](WALLET_MANAGEMENT.md).

Quick example:

```
$provider = ShippingProviderFactory::make('shiprocket', $credentials);

// Check balance
$balance = $provider->getBalance();

// Recharge wallet
$result = $provider->rechargeWallet(1000.00);
```

### Admin Panel

[](#admin-panel)

1. Navigate to `/admin/shipping_provider` to manage providers
2. Add provider credentials
3. Enable/disable providers
4. Set priority for rate calculation

### Manual Webhook Testing (Mock Provider)

[](#manual-webhook-testing-mock-provider)

For testing webhooks without real provider APIs:

1. Navigate to `/admin/manual-webhook`
2. Select a Mock provider shipment
3. Choose new status and details
4. Send webhook to test the flow

See [MANUAL\_WEBHOOK\_TESTING\_GUIDE.md](MANUAL_WEBHOOK_TESTING_GUIDE.md) for details.

### Order Integration

[](#order-integration)

The package automatically integrates with your order show pages:

**Admin Order Page:**

```
import ShippingSection from '@/components/shipping/ShippingSection';

```

**User Order Page:**

```
import UserShippingSection from '@/components/shipping/UserShippingSection';

```

### Programmatic Usage

[](#programmatic-usage)

```
use Susheelbhai\Laraship\Facades\Laraship;

// Get shipping rates
$rates = Laraship::calculateRates($order);

// Book shipment
$shipment = Laraship::bookCourier($order, $providerId, $serviceType);

// Track shipment
$tracking = Laraship::trackShipment($shipment);

// Cancel shipment
Laraship::cancelShipment($shipment);
```

### Wallet Management

[](#wallet-management-1)

Check wallet balance and recharge for providers that support it (e.g., Shiprocket):

```
use Susheelbhai\Laraship\Services\ShippingProviderFactory;

// Get provider instance
$provider = ShippingProviderFactory::make('shiprocket', [
    'email' => 'your@email.com',
    'password' => 'your-password',
]);

// Check wallet balance
$balance = $provider->getBalance();
if ($balance) {
    echo "Balance: {$balance['formatted']}"; // ₹ 5,000.00
    echo "Amount: {$balance['balance']}";    // 5000.00
    echo "Currency: {$balance['currency']}"; // INR
}

// Recharge wallet
$recharge = $provider->rechargeWallet(1000.00, [
    'payment_method' => 'online',
    'transaction_reference' => 'TXN123456',
]);

if ($recharge) {
    echo "Transaction ID: {$recharge['transaction_id']}";
    echo "Amount: {$recharge['amount']}";
    echo "Status: {$recharge['status']}";

    // If payment URL is provided (for online payment)
    if (isset($recharge['payment_url'])) {
        return redirect($recharge['payment_url']);
    }
}
```

**Using with ShippingProvider Model:**

```
use Susheelbhai\Laraship\Models\ShippingProvider;

$provider = ShippingProvider::find($providerId);
$adapter = $provider->getAdapter();

// Check balance
$balance = $adapter->getBalance();

// Recharge wallet
$recharge = $adapter->rechargeWallet(2500.00);
```

**Controller Example:**

```
use Susheelbhai\Laraship\Models\ShippingProvider;
use Illuminate\Http\Request;

class WalletController extends Controller
{
    public function balance($providerId)
    {
        $provider = ShippingProvider::findOrFail($providerId);
        $adapter = $provider->getAdapter();

        $balance = $adapter->getBalance();

        if (!$balance) {
            return response()->json([
                'message' => 'Provider does not support balance API'
            ], 404);
        }

        return response()->json($balance);
    }

    public function recharge(Request $request, $providerId)
    {
        $request->validate([
            'amount' => 'required|numeric|min:100',
            'payment_method' => 'nullable|string',
        ]);

        $provider = ShippingProvider::findOrFail($providerId);
        $adapter = $provider->getAdapter();

        $result = $adapter->rechargeWallet(
            $request->amount,
            $request->only(['payment_method', 'transaction_reference'])
        );

        if (!$result) {
            return response()->json([
                'message' => 'Provider does not support wallet recharge API'
            ], 404);
        }

        // Log the transaction
        \Log::info('Wallet recharged', [
            'provider' => $provider->name,
            'transaction_id' => $result['transaction_id'],
            'amount' => $result['amount'],
        ]);

        return response()->json($result);
    }
}
```

Events
------

[](#events)

- `ShipmentStatusUpdated` - Fired when shipment status changes
- `ShipmentBooked` - Fired when shipment is successfully booked

Notifications
-------------

[](#notifications)

- `ShipmentStatusNotification` - Sent to customers on status updates
- `ShipmentBookedNotification` - Sent when shipment is booked
- `ShipmentDeliveredNotification` - Sent when shipment is delivered

Queue Jobs
----------

[](#queue-jobs)

- `ProcessShipmentBooking` - Async shipment booking
- `UpdateShipmentStatus` - Async status updates
- `SyncTrackingInfo` - Periodic tracking sync

License
-------

[](#license)

MIT

Support
-------

[](#support)

For issues and feature requests, please use the GitHub issue tracker.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance85

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~67 days

Recently: every ~2 days

Total

14

Last Release

77d ago

Major Versions

v1.0.6 → v2.0.02026-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d324a9930fc536f84b495c972521e05384cefea99250652c702e134757ea47f?d=identicon)[susheelbhai](/maintainers/susheelbhai)

---

Top Contributors

[![susheelbhai](https://avatars.githubusercontent.com/u/64020920?v=4)](https://github.com/susheelbhai "susheelbhai (7 commits)")

---

Tags

laravelecommerceshippingcourierlogisticsshiprocketdelhiverybluedart

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/susheelbhai-laraship/health.svg)

```
[![Health](https://phpackages.com/badges/susheelbhai-laraship/health.svg)](https://phpackages.com/packages/susheelbhai-laraship)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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