PHPackages                             vivek-mistry/laravel-inventory-core - 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. [Database &amp; ORM](/categories/database)
4. /
5. vivek-mistry/laravel-inventory-core

ActiveLibrary[Database &amp; ORM](/categories/database)

vivek-mistry/laravel-inventory-core
===================================

Core stock &amp; inventory engine for Laravel applications

1.0.0(4mo ago)9271MITPHPPHP ^8.2||^8.3||^8.4||^8.5

Since Dec 20Pushed 4mo agoCompare

[ Source](https://github.com/vivek-mistry/laravel-inventory-core)[ Packagist](https://packagist.org/packages/vivek-mistry/laravel-inventory-core)[ Docs](https://github.com/vivek-mistry/laravel-inventory-core)[ RSS](/packages/vivek-mistry-laravel-inventory-core/feed)WikiDiscussions main Synced 1mo ago

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

 [![Laravel Inventory Core](docs/images/inventory_core.png)](docs/images/inventory_core.png)

📦 Laravel Inventory Core
------------------------

[](#-laravel-inventory-core)

A Headless Stock &amp; Inventory Engine for Laravel

A lightweight, extensible inventory management core for Laravel applications. Built for e-commerce, POS, ERP, invoicing, and warehouse systems.
⭐ No UI
🧠 Logic-first
⚡ Production-ready

**🚀 Why Laravel Inventory Core?**
Most inventory packages are:
❌ UI-heavy
❌ Hard to customize
❌ Tied to specific schemas \\

**Laravel Inventory Core is different.**
✔ Works with any Eloquent model
✔ Multi-warehouse ready
✔ Prevents overselling
✔ Event-driven &amp; audit-safe
✔ Clean API developers love

✨ Features
----------

[](#-features)

✅ Core Inventory

- Stock in / stock out
- Stock adjustments
- Available vs reserved stock
- Negative stock protection

🔒 Reservation System

- Cart &amp; order reservations
- Overselling prevention
- Safe release mechanism

🏬 Warehouses

- Multiple warehouses / godowns
- Default warehouse support
- Warehouse-aware stock

🔁 Audit &amp; Reliability

- Complete stock movement history
- Traceable inventory changes
- Accounting-friendly design

🚨 Low Stock Alerts

- Threshold-based alerts
- Event-driven notifications

📌 Ideal For
-----------

[](#-ideal-for)

✔ Laravel e-commerce platforms
✔ POS systems
✔ ERP &amp; internal tools
✔ Invoice &amp; billing systems
✔ SaaS products needing inventory

🛠️ Installation
---------------

[](#️-installation)

Install the package via Composer:

```
composer require vivek-mistry/laravel-inventory-core
```

Publish config (optional):

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

Run migrations:

```
php artisan migrate
```

⚙️ Configuration
----------------

[](#️-configuration)

`config/inventory.php`

```
return [
    'default_warehouse' => null,
    'allow_negative_stock' => false,
    'low_stock_threshold' => 5,
];
```

🧱 Database Tables
-----------------

[](#-database-tables)

TablePurpose`inventory_stocks`Current stock per model`inventory_movements`Complete stock audit trail`inventory_warehouses`Multi-warehouse support🧩 Making a Model Stockable
--------------------------

[](#-making-a-model-stockable)

Use the `Stockable` trait on any Eloquent model.

```
use VivekMistry\InventoryCore\Traits\Stockable;

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

That’s it 🎉

🧮 Basic Usage
-------------

[](#-basic-usage)

Add Stock

```
$product->addStock(100);
```

With warehouse

```
$product->addStock(50, ['reason' => 'Initial stock'], warehouseId: 1);
```

➖ Reduce Stock

```
$product->reduceStock(5);
```

🔒 Reserve Stock (Cart / Order)

Prevents overselling.

```
$product->reserveStock(2);
```

With warehouse:

```
$product->reserveStock(2, warehouseId: 1);
```

🔓 Release Reserved Stock

```
$product->releaseStock(2);
```

📊 Stock Helpers

```
$product->availableStock(); // quantity - reserved
$product->reservedStock();
```

🏬 Warehouses

Warehouses are optional but recommended.

```
InventoryWarehouse::create([
    'name' => 'Main Warehouse',
    'code' => 'MAIN',
    'is_default' => true,
]);
```

If no warehouse is provided, the default warehouse is used.

🚨 Low Stock Detection Triggered automatically when stock falls below threshold.

```
'low_stock_threshold' => 5,
```

Listen to the event:

```
use InventoryCore\Events\LowStockDetected;

Event::listen(LowStockDetected::class, function ($event) {
    // Send email, Slack, notification, etc.
});
```

```
## 🧪 Example Flow (Real-World)
$product->addStock(100);
$product->reserveStock(10);   // Cart
$product->availableStock();   // 90
$product->releaseStock(5);    // Cart cancelled
$product->reduceStock(5);
```

🧪 Testing
---------

[](#-testing)

```
vendor/bin/phpuit
```

Change Logs
-----------

[](#change-logs)

- Initial 2 Phases are released.

Credits
-------

[](#credits)

- [Vivek Mistry](https://github.com/vivek-mistry) - Project creator and maintainer

🤝 Contributing
--------------

[](#-contributing)

Pull requests are welcome.
Ideas, issues, and improvements are encouraged.

**⭐ Support the Project**
If this package helps you:
🌟 Star the repository
🧠 Share with the Laravel community
🐛 Report issues &amp; suggestions

License
-------

[](#license)

MIT License. See [LICENSE](/vivek-mistry/laravel-invoice-engine/blob/main/LICENSE) for details.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance74

Regular maintenance activity

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

143d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6015e635581bd32e06c670be33b2475db0a3b5c62cdf6ba65021365e9ebd19c7?d=identicon)[vivek-mistry](/maintainers/vivek-mistry)

---

Top Contributors

[![vivek-mistry](https://avatars.githubusercontent.com/u/32848578?v=4)](https://github.com/vivek-mistry "vivek-mistry (12 commits)")

---

Tags

phplaravelinventorylaravel-inventoryinvoice-inventory-core

### Embed Badge

![Health badge](/badges/vivek-mistry-laravel-inventory-core/health.svg)

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

###  Alternatives

[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2031.2M2](/packages/glushkovds-phpclickhouse-laravel)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)[inani/larapoll

A Laravel package to create polls

25517.7k1](/packages/inani-larapoll)[matchory/elasticsearch

The missing elasticsearch ORM for Laravel!

3059.0k](/packages/matchory-elasticsearch)

PHPackages © 2026

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