PHPackages                             elgibor-solution/laravel-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. elgibor-solution/laravel-inventory

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

elgibor-solution/laravel-inventory
==================================

Inventory, costing (FIFO &amp; Average), journal posting, multi-branch/warehouse/rack, configurable stages for Laravel.

1.0.1(1w ago)035Apache-2.0PHPPHP ^8.1

Since Oct 9Pushed 8mo agoCompare

[ Source](https://github.com/elgiborsolution/laravel-inventory)[ Packagist](https://packagist.org/packages/elgibor-solution/laravel-inventory)[ RSS](/packages/elgibor-solution-laravel-inventory/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

elgibor-solution/laravel-inventory
==================================

[](#elgibor-solutionlaravel-inventory)

**Comprehensive Laravel Inventory, Costing, and Journal Package**
Multi-branch, multi-warehouse, multi-rack, configurable movement stages, FIFO &amp; Average costing, with automatic journal posting.

---

🚀 Overview
----------

[](#-overview)

`elgibor-solution/laravel-inventory` is a full-featured Laravel package for managing **inventory, accounting journal, and cost valuation (FIFO and Moving Average)**.
It is designed for ERP, POS, and SaaS platforms that require accurate, auditable, and multi-location stock control — from branches and warehouses down to racks and stages.

### ✅ Key Features

[](#-key-features)

- **Costing Methods:** FIFO and Moving Average
- **Multi-Location:** Multi-branch, multi-warehouse, multi-rack
- **Configurable Stages:** Customizable per item type
- **Full Document Set:** Purchase, Sales, Returns, Stock Opname, Consignment, Transfers
- **Automatic Journal Entries:** Predefined account mapping for Dr/Cr
- **Audit Trail:** Immutable stock ledger
- **Idempotent Posting:** via `external_id`
- **Modular Design:** Easily extendable or integrated into existing GL/ERP

---

📦 Installation
--------------

[](#-installation)

1. Install the package:

    ```
    composer require elgibor-solution/laravel-inventory:*
    ```
2. Publish configuration &amp; migrate tables:

    ```
    php artisan vendor:publish --tag=inventory-config
    php artisan migrate
    ```

---

⚙️ Configuration (`config/inventory.php`)
-----------------------------------------

[](#️-configuration-configinventoryphp)

```
return [
    'default_valuation' => 'fifo', // 'fifo' | 'average'

    'valuation_scopes' => [
        'per_branch'    => true,
        'per_warehouse' => true,
        'per_rack'      => false,
    ],

    'accounts' => [
        'inventory'             => '1100-INV',
        'cogs'                  => '5100-COGS',
        'ap'                    => '2100-AP',
        'ar'                    => '1101-AR',
        'purchase_return'       => '5201-PurchaseReturn',
        'sales_return'          => '4102-SalesReturn',
        'inventory_gain'        => '5202-InvGain',
        'inventory_loss'        => '5203-InvLoss',
        'inventory_interbranch' => '1180-INV-INTRANSIT',
    ],

    'item_type_stages' => [
        'regular'   => ['pickup_admin_gudang', 'carried_by_salesman', 'delivered_to_store'],
        'fast_move' => ['warehouse_exit', 'received_by_store'],
    ],

    'stage_triggers' => [
        'recognize_cogs_on' => 'final',
    ],
];
```

---

🧠 Core Concepts
---------------

[](#-core-concepts)

### 1. **Cost Valuation**

[](#1-cost-valuation)

- **FIFO:** First In First Out — oldest stock layers consumed first.
- **Average:** Weighted moving average recalculated on every receipt.

### 2. **Location Hierarchy**

[](#2-location-hierarchy)

```
Branch → Warehouse → Rack → Stage

```

Every stock movement references branch, warehouse, and optionally rack.

### 3. **Stages**

[](#3-stages)

Each item type can have its own movement stages.
Example:

Item TypeStagesRegularpickup\_admin\_gudang → carried\_by\_salesman → delivered\_to\_storeFast Movewarehouse\_exit → received\_by\_store---

📄 Supported Documents
---------------------

[](#-supported-documents)

DocumentDescriptionStock EffectAccounting Effect**Purchase**Goods received from supplierINDr Inventory / Cr AP**Sale**Goods delivered to customerOUTDr COGS / Cr Inventory**Purchase Return**Goods returned to supplierOUTDr AP / Cr Inventory**Sales Return**Goods returned from customerINDr Inventory / Cr COGS**Stock Opname**Physical stock adjustmentIN/OUTDr/C Inventory Gain/Loss**Consignment**Goods sent to consignmentOUTOptional (On/Off Balance)**Transfer Rack**Move between racksIN/OUTNo journal**Transfer Warehouse**Move between warehousesIN/OUTNo journal**Transfer Branch**Move between branchesIN/OUTDr Inventory (Dest) / Cr Inventory (Src)---

🧾 Usage Examples
----------------

[](#-usage-examples)

(Examples section omitted here for brevity — same as full README above)

---

📊 Suggested SQL View
--------------------

[](#-suggested-sql-view)

```
CREATE VIEW inv_item_balances AS
SELECT
  item_id, branch_id, warehouse_id, rack_id,
  SUM(CASE WHEN direction='in' THEN qty ELSE -qty END) AS qty_on_hand,
  SUM(CASE WHEN direction='in' THEN amount ELSE -amount END) AS amount_on_hand
FROM inv_stock_ledgers
GROUP BY item_id, branch_id, warehouse_id, rack_id;
```

---

🛡️ Best Practices
-----------------

[](#️-best-practices)

- Always post documents within a **DB transaction**.
- Never modify `inv_stock_ledgers` or `inv_cost_layers` manually.
- Use `external_id` to ensure idempotent synchronization.
- Add indexes `(item_id, branch_id, warehouse_id, rack_id, created_at)` for performance.
- `lockForUpdate()` is used to ensure cost consistency under concurrency.

---

🧰 Recommended Extensions
------------------------

[](#-recommended-extensions)

- Add `DocumentPosted` events for webhook integration.
- Extend `JournalManager` to push entries to your accounting module.
- Create `InventoryPolicy` to control stage posting permissions by user role.

---

📜 License
---------

[](#-license)

**Apache 2.0 License**
© 2025 PT Elgibor Solusi Digital

###  Health Score

37

↑

LowBetter than 81% of packages

Maintenance76

Regular maintenance activity

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~258 days

Total

2

Last Release

10d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5470172?v=4)[esolution](/maintainers/esolution)[@esolution](https://github.com/esolution)

---

Top Contributors

[![elgibor-solution](https://avatars.githubusercontent.com/u/783039?v=4)](https://github.com/elgibor-solution "elgibor-solution (3 commits)")

### Embed Badge

![Health badge](/badges/elgibor-solution-laravel-inventory/health.svg)

```
[![Health](https://phpackages.com/badges/elgibor-solution-laravel-inventory/health.svg)](https://phpackages.com/packages/elgibor-solution-laravel-inventory)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)

PHPackages © 2026

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