PHPackages                             malikad778/nexus-inventory - 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. malikad778/nexus-inventory

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

malikad778/nexus-inventory
==========================

Multi-channel inventory synchronization for Laravel.

v1.0.1(4mo ago)2904[1 issues](https://github.com/malikad778/nexus-inventory/issues)[5 PRs](https://github.com/malikad778/nexus-inventory/pulls)MITPHPPHP ^8.2CI passing

Since Feb 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/malikad778/nexus-inventory)[ Packagist](https://packagist.org/packages/malikad778/nexus-inventory)[ Docs](https://github.com/malikad778/nexus-inventory)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/malikad778-nexus-inventory/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (14)Versions (13)Used By (0)

Nexus Inventory
===============

[](#nexus-inventory)

[![Latest Version on Packagist](https://camo.githubusercontent.com/df62caba53a034be9b4f2fc4c8b6719453f128508d8cf30a8bf832d9b8572a47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616c696b61643737382f6e657875732d696e76656e746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/malikad778/nexus-inventory)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a7db807c49e1f4ed0972b5ddc35fa34a14d88e8101e5543bfe4079bc5ef40800/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d616c696b61643737382f6e657875732d696e76656e746f72792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/malikad778/nexus-inventory/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7a9abcae96914bc4931277b934347fff72dcc5986ea540465ea52c886c4b9b17/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d616c696b61643737382f6e657875732d696e76656e746f72792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/malikad778/nexus-inventory/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/36fd4ddb70b73856e675e522d00b1af72b7a6deca2e35cf8438534dbf0ffd359/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616c696b61643737382f6e657875732d696e76656e746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/malikad778/nexus-inventory)[![License](https://camo.githubusercontent.com/1f3adaeb297a765d870a9265e9e7bc920bfbf7db990337bf972cd7f3451d41db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d616c696b61643737382f6e657875732d696e76656e746f72792e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

**A unified, driver-based Laravel package for synchronizing products and inventory across multiple e-commerce channels — Shopify, WooCommerce, Amazon SP-API, and Etsy.**

Nexus Inventory is not a SaaS platform. It is a drop-in Composer package that lives inside your Laravel application, giving you full code-level control over every sync, every webhook, and every rate limit — for free.

---

Why Nexus Inventory?
--------------------

[](#why-nexus-inventory)

The multi-channel commerce problem is real and expensive. When a product sells on Amazon, your Shopify stock must decrement in seconds — not minutes. Every channel has its own API, its own authentication scheme, its own rate limits, and its own webhook signature format. Solving this from scratch takes months.

The existing options leave developers stuck:

OptionProblem**SaaS (Cin7, Linnworks)**$300–$500/month, no code control, no custom sync logic**DIY integrations**6–12 weeks per channel, brittle, non-reusable**Channel-specific packages**Siloed — no unified DTO, no cross-channel orchestration**Nexus Inventory fills the gap.** It provides a production-grade, extensible foundation — a unified driver interface, a fluent API, distributed rate limiting, secure webhook handling, job batching, and a real-time dashboard — all installable in minutes via Composer.

---

Features
--------

[](#features)

### 🔌 Driver-Based Architecture

[](#-driver-based-architecture)

Every channel implements the same `InventoryDriver` interface. Your application code never touches a channel SDK directly. Add support for a new channel (eBay, TikTok Shop, Walmart) by implementing one interface and registering one class — zero changes to the core.

```
// Identical API regardless of channel
Nexus::driver('shopify')->fetchProduct($remoteId);
Nexus::driver('amazon')->updateInventory($remoteId, 42);
Nexus::driver('woocommerce')->getProducts(now()->subHours(24));
```

### 🔄 Fluent Sync API

[](#-fluent-sync-api)

A clean, chainable builder API for common sync operations:

```
// Push a single inventory update to specific channels
Nexus::product($product)
    ->updateInventory(quantity: 42)
    ->sync(['shopify', 'amazon']);

// Bulk sync your entire catalog across all channels
$batch = Nexus::catalog($products)->syncAll();

// Monitor batch progress
$status = Nexus::batch($batchId)->status();
```

### ⚡ Distributed Rate Limiting

[](#-distributed-rate-limiting)

Each channel enforces API rate limits at the key level — not the server level. Run 10 queue workers and a naive implementation blows through your API quota in seconds. Nexus solves this with a **Token Bucket algorithm backed by atomic Redis Lua scripting**, race-condition-free across any number of concurrent workers.

ChannelRate LimitBurst CapacityShopify2 req/sec40 tokensWooCommerce25 req/sec100 tokensAmazon SP-API1 req/sec10 tokensEtsy10 req/sec50 tokens### 📦 Three-Layer Job Architecture

[](#-three-layer-job-architecture)

Syncing 10,000 SKUs across 4 channels means 40,000 API calls. Nexus handles this with a structured job hierarchy using Laravel's `Bus::batch()`:

- **`CatalogSyncJob`** — Orchestrator. Partitions the catalog, creates the batch, registers `then()` and `catch()` callbacks.
- **`ChannelSyncBatchJob`** — Channel executor. Acquires rate limit tokens, dispatches push jobs, fires lifecycle events.
- **`PushInventoryJob`** — Atomic unit per SKU/channel pair. Implements `ShouldBeUnique` to prevent duplicate in-flight jobs.

### 🔒 Secure Unified Webhook Receiver

[](#-secure-unified-webhook-receiver)

A single route handles all four channels. Every request is cryptographically verified before processing:

- **Shopify** — `X-Shopify-Hmac-Sha256` — HMAC-SHA256 (base64)
- **WooCommerce** — `X-WC-Webhook-Signature` — HMAC-SHA256 (base64)
- **Amazon** — `X-AMZ-SNS-Signature` — RSA-SHA1 via AWS SNS (certificate downloaded, domain-validated, cached)
- **Etsy** — `X-Etsy-Signature` — HMAC-SHA256 (hex)

```
POST https://your-app.com/nexus/webhooks/shopify
POST https://your-app.com/nexus/webhooks/woocommerce
POST https://your-app.com/nexus/webhooks/amazon
POST https://your-app.com/nexus/webhooks/etsy

```

### 📡 Standardized Event System

[](#-standardized-event-system)

Once a webhook is verified, a single `InventoryUpdated` event fires — regardless of which channel triggered it. Write one listener to handle all channels:

```
class PropagateInventoryToOtherChannels
{
    public function handle(InventoryUpdated $event): void
    {
        $others = ['shopify', 'amazon', 'woocommerce', 'etsy'];

        Nexus::product($event->product)
            ->updateInventory($event->newQuantity)
            ->sync(array_diff($others, [$event->channel]));
    }
}
```

Full lifecycle hooks at every stage of the pipeline:

EventFires When`BeforeInventorySync`Before each channel push — ideal for safety stock rules`AfterInventorySync`On success — notify WMS, trigger downstream workflows`InventorySyncFailed`On permanent failure after retries — alert Slack, PagerDuty`InventoryUpdated`After every verified webhook`WebhookReceived`Before processing — full audit logging`ChannelThrottled`When a channel API is throttling — broadcasts via Laravel Reverb`ProductImported`When a product is fetched from a channel during catalog import### 🗄️ Polymorphic Channel Mapping

[](#️-polymorphic-channel-mapping)

Any Eloquent model becomes syncable with one trait — no schema changes to your existing tables:

```
use Malikad778\\LaravelNexus\Traits\Syncable;

class Product extends Model
{
    use Syncable;
    // Adds: $product->channelMappings(), $product->syncTo('shopify')
}
```

The `nexus_channel_mappings` table stores each channel's remote ID against your local model using a polymorphic relationship with a composite unique index, preventing duplicate mappings.

### 💀 Dead Letter Queue

[](#-dead-letter-queue)

Jobs that exhaust all retries are written to `nexus_dead_letter_queue` with their full serialized payload and exception detail. No silent failures. From the dashboard you can replay individual jobs or bulk-replay after an API outage — no artisan required.

### 📊 Real-Time Livewire Dashboard

[](#-real-time-livewire-dashboard)

A Livewire 3 dashboard at `/nexus` with wire:poll.3s real-time updates:

- **Channel Status Cards** — Connected / Throttled / Disconnected, with live token bucket fill level per channel
- **Sync Job Monitor** — Active `Bus::batch()` instances with per-job progress
- **Webhook Event Log** — Paginated, searchable log of every inbound webhook with verification status and processing duration
- **Dead Letter Queue Manager** — Replay or resolve failed jobs with one click
- **Real-Time Alerts** — `ChannelThrottled` broadcasts via Laravel Reverb when rate limiting is detected

### 🔧 Extensible Driver System

[](#-extensible-driver-system)

Register community-contributed or internal channel drivers without touching the package core:

```
// In AppServiceProvider::boot()
Nexus::extend('ebay', function ($app) {
    return new EbayInventoryDriver(
        config: $app['config']['nexus.channels.ebay'],
        client: $app->make(EbayApiClient::class)
    );
});

// eBay is now a first-class channel
Nexus::product($product)->updateInventory(10)->sync(['shopify', 'ebay']);
```

### 🧩 Normalized Product DTOs

[](#-normalized-product-dtos)

Channel-specific product structures are normalized into a single `NexusProduct` DTO, eliminating transformation logic from your application:

```
NexusProduct::fromShopify($payload);     // variants[], inventory_item_id, barcode
NexusProduct::fromWooCommerce($payload); // stock_quantity, variations[]
NexusProduct::fromAmazon($payload);      // ASIN, seller_sku, quantity
NexusProduct::fromEtsy($payload);        // listing_id, skus[], price divisor
```

The `channelMeta` field preserves the raw channel payload so channel-specific data (Amazon FBA routing, Etsy listing state) is never permanently discarded.

---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12+
- Redis (for rate limiting and queues)
- MySQL 8+ or PostgreSQL

---

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

[](#installation)

```
composer require malikad778/nexus-inventory
```

Publish the config file and migrations:

```
php artisan vendor:publish --tag="nexus-config"
php artisan vendor:publish --tag="nexus-migrations"
php artisan migrate
```

---

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

[](#configuration)

Add channel credentials to your `.env`:

```
# Shopify
SHOPIFY_SHOP_URL=your-shop.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_...
SHOPIFY_WEBHOOK_SECRET=whsec_...
SHOPIFY_LOCATION_ID=...

# WooCommerce
WOOCOMMERCE_STORE_URL=https://your-store.com
WOOCOMMERCE_CONSUMER_KEY=ck_...
WOOCOMMERCE_CONSUMER_SECRET=cs_...
WOOCOMMERCE_WEBHOOK_SECRET=...

# Amazon SP-API
AMAZON_CLIENT_ID=amzn1.application-oa2-client...
AMAZON_CLIENT_SECRET=...
AMAZON_REFRESH_TOKEN=Atzr|...
AMAZON_SELLER_ID=...
AMAZON_ACCESS_KEY_ID=...
AMAZON_SECRET_ACCESS_KEY=...
AMAZON_REGION=us-east-1

# Etsy
ETSY_KEYSTRING=...
ETSY_SHARED_SECRET=...
ETSY_SHOP_ID=...
ETSY_WEBHOOK_SECRET=...
```

See `config/nexus.php` for rate limit overrides, dashboard middleware, and queue configuration.

---

Usage
-----

[](#usage)

### Sync a Single Product

[](#sync-a-single-product)

```
use Malikad778\\LaravelNexus\Facades\Nexus;

// All configured channels
Nexus::product($product)->updateInventory(quantity: 42)->sync();

// Specific channels only
Nexus::product($product)->updateInventory(quantity: 42)->sync(['shopify', 'amazon']);
```

### Bulk Catalog Sync

[](#bulk-catalog-sync)

```
$batch = Nexus::catalog($products)->syncAll();
```

### Access Drivers Directly

[](#access-drivers-directly)

```
$product  = Nexus::driver('shopify')->fetchProduct('gid://shopify/Product/789');
$products = Nexus::driver('woocommerce')->getProducts(now()->subHours(24));
$success  = Nexus::driver('etsy')->pushInventory($nexusInventoryUpdate);
```

### Listen to Events

[](#listen-to-events)

```
// In EventServiceProvider
protected $listen = [
    \Malikad778\\LaravelNexus\Events\InventoryUpdated::class => [
        PropagateInventoryToOtherChannels::class,
    ],
    \Malikad778\\LaravelNexus\Events\BeforeInventorySync::class => [
        EnforceSafetyStockListener::class,
    ],
    \Malikad778\\LaravelNexus\Events\InventorySyncFailed::class => [
        AlertOpsTeamListener::class,
    ],
    \Malikad778\\LaravelNexus\Events\ProductImported::class => [
        CreateLocalProductListener::class,
    ],
];
```

### Make Your Model Syncable

[](#make-your-model-syncable)

```
use Malikad778\\LaravelNexus\Traits\Syncable;

class Product extends Model
{
    use Syncable;
}

// Access channel mappings
$shopifyId = $product->channelMappings()->where('channel', 'shopify')->value('remote_id');
```

### Dashboard

[](#dashboard)

Visit `/nexus`. Secure it in `config/nexus.php`:

```
'dashboard_middleware' => ['web', 'auth'],
```

### Queue Workers

[](#queue-workers)

```
php artisan queue:work redis --queue=nexus,default
```

---

Architecture Overview
---------------------

[](#architecture-overview)

 ```
graph TD
    A[Your Application] -->|Nexus::product / catalog| B(InventoryManager)
    B --> C{InventoryDriver}
    C -->|REST + HMAC| D[ShopifyDriver]
    C -->|REST v3 + Basic Auth| E[WooCommerceDriver]
    C -->|SP-API + AWS SigV4| F[AmazonDriver]
    C -->|OAuth2 PKCE| G[EtsyDriver]

    H[Inbound Webhooks] -->|Signed Payload| I[VerifyNexusWebhookSignature]
    I -->|Verified| J[WebhookController]
    J -->|InventoryUpdated event| K[Your Listeners]
    K -->|Nexus::product| B

    L[CatalogSyncJob] -->|Bus::batch| M[ChannelSyncBatchJob × channels]
    M -->|Token acquired| N[PushInventoryJob × SKUs]
    N -->|Exhausted retries| O[(nexus_dead_letter_queue)]

    P[TokenBucket] -->|Lua atomic eval| Q[(Redis)]
    M --> P
```

      Loading ---

Database Tables
---------------

[](#database-tables)

TablePurpose`nexus_channel_mappings`Polymorphic map between local models and remote channel IDs`nexus_sync_jobs`Active and historical job tracking with batch IDs and status`nexus_dead_letter_queue`Permanently failed jobs with full payload for one-click replay`nexus_webhook_logs`Audit log of every inbound webhook with verification status`nexus_rate_limit_logs`Per-channel rate limit event tracking for dashboard visibility---

Testing
-------

[](#testing)

```
composer test
```

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent changes.

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance83

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

129d ago

### Community

Maintainers

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

---

Top Contributors

[![malikad778](https://avatars.githubusercontent.com/u/86764206?v=4)](https://github.com/malikad778 "malikad778 (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

amazon-sp-apidropshippingecommerceetsy-apiinventory-managemenlaravellaravel-packagemarketplacemulti-channelpackagephpqueue-jobsshopifysynchronizationwoocommercelaravelamazonsynchronizationshopifywoocommerceinventoryetsynexus-inventory

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/malikad778-nexus-inventory/health.svg)

```
[![Health](https://phpackages.com/badges/malikad778-nexus-inventory/health.svg)](https://phpackages.com/packages/malikad778-nexus-inventory)
```

###  Alternatives

[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)[leandrocfe/filament-apex-charts

Apex Charts integration for Filament PHP.

4911.6M11](/packages/leandrocfe-filament-apex-charts)[filament/support

Core helper methods and foundation code for all Filament packages.

2331.0M245](/packages/filament-support)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

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

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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