PHPackages                             mortezaa97/inventories - 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. mortezaa97/inventories

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

mortezaa97/inventories
======================

v1.0.2(6mo ago)00MITPHPPHP ^8.2CI passing

Since Oct 25Pushed 6mo agoCompare

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

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Inventories Package
===================

[](#inventories-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2005de64dd344e83da0e8e469013798b89890594f248b39c101cf0e4f6b195aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f7274657a616139372f696e76656e746f726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mortezaa97/inventories)[![Total Downloads](https://camo.githubusercontent.com/952780aba5c0065255e16fafe342a204a9d190d4a166e561a4f3e778a45c4a7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f7274657a616139372f696e76656e746f726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mortezaa97/inventories)

A comprehensive Filament plugin for managing inventories and inventory logs with polymorphic tracking, full CRUD interface, and detailed history.

Features
--------

[](#features)

- 📦 **Inventory Management**: Track stock levels across multiple warehouses
- 📊 **Inventory Logs**: Complete history of all inventory changes
- 🔗 **Polymorphic Tracking**: Link inventory changes to any model (products, orders, etc.)
- 🎯 **HasInventoryLogs Trait**: Easy integration with existing models
- 🔐 **Authorization**: Built-in policies for secure access control
- 🌐 **API Ready**: RESTful API endpoints for all resources
- 📈 **Relation Manager**: Built-in Filament relation manager for inventory logs
- 🇮🇷 **Persian Support**: Full RTL and Persian language support

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

[](#installation)

### 1. Require the package via Composer

[](#1-require-the-package-via-composer)

```
composer require mortezaa97/inventories
```

### 2. Register the Plugin

[](#2-register-the-plugin)

In your `app/Providers/Filament/AdminPanelServiceProvider.php`:

```
use Mortezaa97\Inventories\InventoriesPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            InventoriesPlugin::make(),
        ]);
}
```

### 3. Run Migrations

[](#3-run-migrations)

```
php artisan migrate
```

### 4. Clear Caches

[](#4-clear-caches)

```
php artisan config:clear
php artisan cache:clear
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag="inventories-config"
```

Publish migrations:

```
php artisan vendor:publish --tag="inventories-migrations"
```

Usage
-----

[](#usage)

See [PLUGIN\_USAGE.md](PLUGIN_USAGE.md) for detailed usage instructions.

Quick Example
-------------

[](#quick-example)

```
use Mortezaa97\Inventories\Models\Inventory;
use Mortezaa97\Inventories\Traits\HasInventoryLogs;

// Add trait to your model
class Product extends Model
{
    use HasInventoryLogs;
}

// Create inventory
$inventory = Inventory::create([
    'name' => 'Main Warehouse',
    'count' => 100,
    'created_by' => auth()->id(),
]);

// Increase inventory
$product->increaseInventory($inventory->id, 50);

// Decrease inventory
$product->decreaseInventory($inventory->id, 10);

// Get all logs
$logs = $product->inventoryLogs;
```

Available Models
----------------

[](#available-models)

### Inventory

[](#inventory)

- Tracks stock levels
- Has many inventory logs
- Soft deletable

### InventoryLog

[](#inventorylog)

- Records all changes
- Polymorphic relationship to any model
- Tracks increase/decrease operations
- Soft deletable

Available Trait
---------------

[](#available-trait)

### HasInventoryLogs

[](#hasinventorylogs)

Add inventory tracking to any model:

```
use Mortezaa97\Inventories\Traits\HasInventoryLogs;

class YourModel extends Model
{
    use HasInventoryLogs;

    // Available methods:
    // - inventoryLogs()
    // - addInventoryLog()
    // - increaseInventory()
    // - decreaseInventory()
    // - inventoryLogsFor()
}
```

API Routes
----------

[](#api-routes)

- `/api/inventories` - Inventory CRUD
- `/api/inventory-logs` - Inventory Log CRUD

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [mortezaa97](https://github.com/mortezaa97)

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance73

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

180d ago

### Community

Maintainers

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

---

Top Contributors

[![mortezaa97](https://avatars.githubusercontent.com/u/57325086?v=4)](https://github.com/mortezaa97 "mortezaa97 (3 commits)")

---

Tags

mortezaa97inventories

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mortezaa97-inventories/health.svg)

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

###  Alternatives

[illuminate/events

The Illuminate Events package.

13454.3M1.7k](/packages/illuminate-events)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.5M177](/packages/illuminate-broadcasting)[igorsgm/laravel-git-hooks

🪝• Efficiently manage Git hooks in Laravel projects. Enhance code quality, save time on reviews, and prevent bugs from entering your repository.

2931.7k1](/packages/igorsgm-laravel-git-hooks)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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