Product Lots
Description
Product Lots adds batch and expiry tracking for products in Laravel Enso.
The package exposes a standard CRUD and table API for product lots and provides the lot model used by inventory flows to compute remaining stock per lot.
It is intended for inventory-driven applications that need traceable purchase lots, expiry-based filtering, and available quantity computation.
Installation
Install the package:
composer require laravel-enso/product-lots
Run the package migrations:
php artisan migrate
Features
- Product lot CRUD, table init, table data, and Excel export endpoints.
Lotmodel withproduct()andinventoryIns()relations.- Computed
availableQuantityaccessor based on remaining inbound inventory. - Date scopes for
expiresAfter()andexpiresBefore(). - Rememberable cache keys for lot
idandcode.
Usage
Main route group:
administration.productLots.*
Lots are linked to products and are later consumed by inventory flows that record inbound quantities against a given lot.
Useful model helpers:
$lot->availableQuantity();
Lot::query()->expiresBefore(now()->addMonth());
API
HTTP routes
GET api/administration/productLotsGET api/administration/productLots/createPOST api/administration/productLotsGET api/administration/productLots/{lot}/editPATCH api/administration/productLots/{lot}DELETE api/administration/productLots/{lot}GET api/administration/productLots/initTableGET api/administration/productLots/tableDataGET api/administration/productLots/exportExcel
Depends On
Required Enso packages:
Companion frontend package: