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

ActiveLibrary

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

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

1.0.0(7mo ago)03Apache-2.0PHPPHP ^8.1

Since Oct 9Pushed 7mo 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 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)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

31

—

LowBetter than 68% of packages

Maintenance65

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

215d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5e7899407946e1ed48940ae3b5fea2477eacc7ec98e9f53122e2d97718b7087?d=identicon)[esolution](/maintainers/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

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

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