Locations
Managing warehouses and storage hierarchy.
Location Management
Obelaw WMS treats all storage areas as Location models arranged in a hierarchy. A location can be a physical building (Warehouse), a specific Zone, or a shelf Bin.
Location Model
The Obelaw\Wms\Models\Location model includes:
warehouse_id: The top-level root warehouse ID.parent_id: For nested structures (e.g., Aisle inside Zone).name: Descriptive name (e.g., “Main Warehouse”, “Row A”).type: A value from theLocationTypeEnum.
Location Types
The Obelaw\Wms\Enums\LocationType enum defines the diverse nature of locations:
WAREHOUSE(1)STORAGE_BIN(2)RECEIVING_DOCK(3)PICKING_ZONE(4)QUALITY_CONTROL(5)VIRTUAL_LOCATION(6)
Using the Location Service
Access via WMS::locations().
Creating a Location
use Obelaw\Wms\Facades\WMS;
use Obelaw\Wms\Enums\LocationType;
// Create a root warehouse
$warehouse = WMS::locations()->create([
'name' => 'Main Center',
'type' => LocationType::WAREHOUSE,
]);
// Create a bin inside that warehouse
$bin = WMS::locations()->create([
'name' => 'Bin A-01',
'type' => LocationType::STORAGE_BIN,
'warehouse_id' => $warehouse->id,
'parent_id' => $warehouse->id
]);
Finding Locations
// Find by ID
$location = WMS::locations()->find($id);
Updating Locations
WMS::locations()->update($location, [
'name' => 'New Name'
]);
Deleting Locations
WMS::locations()->delete($location);