PHPackages                             azaharizaman/nexus-manufacturing - 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. azaharizaman/nexus-manufacturing

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

azaharizaman/nexus-manufacturing
================================

Framework-agnostic manufacturing and production management for Nexus ERP - BOM, Work Orders, Routings, MRP, CRP with ML-powered demand forecasting

v0.1.0-alpha1(2mo ago)00MITPHPPHP ^8.3

Since May 5Pushed 2mo agoCompare

[ Source](https://github.com/azaharizaman/nexus-manufacturing)[ Packagist](https://packagist.org/packages/azaharizaman/nexus-manufacturing)[ RSS](/packages/azaharizaman-nexus-manufacturing/feed)WikiDiscussions main Synced 1w ago

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

Nexus Manufacturing Package
===========================

[](#nexus-manufacturing-package)

[![PHP Version](https://camo.githubusercontent.com/83d697baa78e4225d630587096ed1b0d8a0ece94e9b2ebab599fc9bb986477ac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)![Tests](https://camo.githubusercontent.com/5aeaaae37f55eb1b6415ca43ec9d5d1c29351207e031279171fbc46ce49a98bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d3136302532307061737365642d627269676874677265656e2e737667)

**A comprehensive, framework-agnostic manufacturing management package for PHP 8.3+**

The Manufacturing package provides enterprise-grade production management capabilities including Bill of Materials (BOM), Work Orders, Routings, Material Requirements Planning (MRP), and Capacity Requirements Planning (CRP).

---

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

[](#-features)

### Core Capabilities

[](#core-capabilities)

- **📋 Bill of Materials (BOM)**

    - Multi-level BOMs with unlimited nesting
    - Phantom (non-stocked) components
    - Versioning with effectivity dates
    - Cycle detection for circular references
    - Configurable BOMs for variants
- **🔄 Routings &amp; Operations**

    - Operation sequencing with work centers
    - Setup, run, and queue times
    - Overlapping operations
    - Alternate routings
    - Subcontract operations
- **📝 Work Orders**

    - Full lifecycle management (Draft → Planned → Released → In Progress → Completed → Closed)
    - Material reservation and issue tracking
    - Operation completion recording
    - Scrap tracking
    - Sub-assemblies support
- **📊 MRP Engine**

    - Gross-to-net requirements calculation
    - Time-phased planning buckets
    - Multiple lot-sizing strategies:
        - Fixed Order Quantity
        - Economic Order Quantity (EOQ)
        - Period Order Quantity (POQ)
        - Least Unit Cost
    - Lead time offsetting
    - Net change vs regenerative modes
- **⚡ Capacity Planning**

    - Finite and infinite capacity loading
    - Work center calendar integration
    - Capacity profiles and utilization
    - Planning horizon zones (Frozen/Slushy/Liquid)
    - Intelligent overload resolution suggestions
- **🔮 Demand Forecasting**

    - ML-powered predictions integration
    - Historical fallback with confidence tracking
    - Seasonal adjustment support
    - Forecast accuracy metrics

---

📦 Installation
--------------

[](#-installation)

```
composer require azaharizaman/nexus-manufacturing
```

---

🚀 Quick Start
-------------

[](#-quick-start)

### Basic BOM Management

[](#basic-bom-management)

```
use Nexus\Manufacturing\Services\BomManager;
use Nexus\Manufacturing\ValueObjects\BomLine;

// Create BOM manager with repository dependency
$bomManager = new BomManager($bomRepository);

// Create a new BOM
$bom = $bomManager->create(
    productId: 'PROD-001',
    version: '1.0',
    type: 'manufacturing',
    lines: [],
    effectiveFrom: new DateTimeImmutable('2024-01-01')
);

// Add components
$bomManager->addLine($bom->getId(), new BomLine(
    productId: 'COMP-001',
    quantity: 2.0,
    uomCode: 'EA',
    lineNumber: 10,
    scrapFactor: 0.05
));

$bomManager->addLine($bom->getId(), new BomLine(
    productId: 'COMP-002',
    quantity: 1.5,
    uomCode: 'KG',
    lineNumber: 20,
));

// Explode BOM to get all materials
$materials = $bomManager->explode($bom->getId(), quantity: 100);
```

### Work Order Lifecycle

[](#work-order-lifecycle)

```
use Nexus\Manufacturing\Services\WorkOrderManager;
use Nexus\Manufacturing\Enums\WorkOrderStatus;

$workOrderManager = new WorkOrderManager($repository, $bomManager, $routingManager);

// Create work order
$workOrder = $workOrderManager->create(
    productId: 'PROD-001',
    quantity: 100.0,
    plannedStartDate: new DateTimeImmutable('2024-02-01'),
    plannedEndDate: new DateTimeImmutable('2024-02-15'),
    bomId: 'bom-001',
    routingId: 'routing-001'
);

// Release for production
$workOrderManager->release($workOrder->getId());

// Start production
$workOrderManager->start($workOrder->getId());

// Record operation completion
$workOrderManager->completeOperation(
    workOrderId: $workOrder->getId(),
    operationSequence: 10,
    completedQty: 100.0,
    scrapQty: 2.0,
    laborHours: 8.5
);

// Complete and close
$workOrderManager->complete($workOrder->getId());
$workOrderManager->close($workOrder->getId());
```

### MRP Calculation

[](#mrp-calculation)

```
use Nexus\Manufacturing\Services\MrpEngine;
use Nexus\Manufacturing\ValueObjects\PlanningHorizon;
use Nexus\Manufacturing\Enums\LotSizingStrategy;

$mrpEngine = new MrpEngine(
    $bomManager,
    $inventoryProvider,
    $demandProvider,
    $plannedOrderRepository
);

// Define planning horizon
$horizon = new PlanningHorizon(
    startDate: new DateTimeImmutable('2024-01-01'),
    endDate: new DateTimeImmutable('2024-03-31'),
    bucketSize: 7, // Weekly buckets
    frozenDays: 14,
    slushyDays: 28
);

// Run MRP
$result = $mrpEngine->run(
    productIds: ['PROD-001', 'PROD-002'],
    horizon: $horizon,
    lotSizingStrategy: LotSizingStrategy::ECONOMIC_ORDER_QUANTITY
);

// Process planned orders
foreach ($result->getPlannedOrders() as $order) {
    echo sprintf(
        "Product: %s, Qty: %.2f, Due: %s\n",
        $order->getProductId(),
        $order->getQuantity(),
        $order->getDueDate()->format('Y-m-d')
    );
}
```

### Capacity Planning

[](#capacity-planning)

```
use Nexus\Manufacturing\Services\CapacityPlanner;
use Nexus\Manufacturing\Enums\CapacityLoadType;

$capacityPlanner = new CapacityPlanner(
    $workCenterRepository,
    $workOrderRepository,
    $routingManager,
    $capacityResolver
);

// Check capacity for work center
$profile = $capacityPlanner->getCapacityProfile(
    workCenterId: 'WC-001',
    startDate: new DateTimeImmutable('2024-02-01'),
    endDate: new DateTimeImmutable('2024-02-28'),
    loadType: CapacityLoadType::FINITE
);

// Get utilization by period
foreach ($profile->getPeriods() as $period) {
    echo sprintf(
        "%s: %.1f%% utilized\n",
        $period->getDate()->format('Y-m-d'),
        $period->getUtilizationPercent()
    );
}

// Get resolution suggestions for overloads
$suggestions = $capacityPlanner->getResolutionSuggestions('WC-001', $overloadPeriod);
foreach ($suggestions as $suggestion) {
    echo sprintf(
        "Action: %s, Estimated Savings: %.1f hours\n",
        $suggestion->getAction()->value,
        $suggestion->getEstimatedImpact()
    );
}
```

---

📂 Package Structure
-------------------

[](#-package-structure)

```
src/
├── Contracts/           # 27 Interfaces
│   ├── BomInterface.php
│   ├── BomManagerInterface.php
│   ├── WorkOrderInterface.php
│   ├── MrpEngineInterface.php
│   └── ...
├── Enums/              # 8 Enums
│   ├── WorkOrderStatus.php
│   ├── BomType.php
│   ├── LotSizingStrategy.php
│   └── ...
├── ValueObjects/       # 13 Value Objects
│   ├── BomLine.php
│   ├── Operation.php
│   ├── PlannedOrder.php
│   └── ...
├── Exceptions/         # 13 Exceptions
│   ├── BomNotFoundException.php
│   ├── CircularBomException.php
│   └── ...
├── Events/            # 11 Domain Events
│   ├── WorkOrderReleasedEvent.php
│   └── ...
└── Services/          # 9 Service Classes
    ├── BomManager.php
    ├── WorkOrderManager.php
    ├── MrpEngine.php
    ├── CapacityPlanner.php
    └── ...

```

---

🔌 Integration with Nexus Packages
---------------------------------

[](#-integration-with-nexus-packages)

### Nexus\\Inventory

[](#nexusinventory)

```
// Implement InventoryDataProviderInterface
class InventoryAdapter implements InventoryDataProviderInterface
{
    public function __construct(
        private readonly StockManagerInterface $stockManager
    ) {}

    public function getOnHandQuantity(string $productId, string $warehouseId): float
    {
        return $this->stockManager->getAvailableStock($productId, $warehouseId);
    }
}
```

### Nexus\\MachineLearning

[](#nexusmachinelearning)

```
// Implement ForecastProviderInterface for ML predictions
class MlForecastAdapter implements ForecastProviderInterface
{
    public function __construct(
        private readonly AnomalyDetectionServiceInterface $mlService
    ) {}

    public function getForecast(string $productId, DateTimeImmutable $date): ?DemandForecast
    {
        $prediction = $this->mlService->predict('demand_forecast', [
            'product_id' => $productId,
            'date' => $date->format('Y-m-d'),
        ]);

        return new DemandForecast(
            productId: $productId,
            forecastDate: $date,
            quantity: $prediction['quantity'],
            confidence: ForecastConfidence::from($prediction['confidence'])
        );
    }
}
```

---

📋 Requirements
--------------

[](#-requirements)

- PHP 8.3 or higher
- PSR-4 autoloading
- PSR-3 Logger (optional)

### Required Dependencies

[](#required-dependencies)

- `psr/log` ^3.0

### Suggested Dependencies

[](#suggested-dependencies)

- `azaharizaman/nexus-inventory` - For stock integration
- `azaharizaman/nexus-product` - For product data
- `azaharizaman/nexus-machine-learning` - For demand forecasting
- `azaharizaman/nexus-event-stream` - For event sourcing

---

📖 Documentation
---------------

[](#-documentation)

- [Getting Started](docs/getting-started.md)
- [API Reference](docs/api-reference.md)
- [Integration Guide](docs/integration-guide.md)
- [Examples](docs/examples/)

---

🧪 Testing
---------

[](#-testing)

```
# Run all tests
composer test

# Run with coverage
composer test -- --coverage-html coverage/
```

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

---

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

[](#-contributing)

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

---

📚 References
------------

[](#-references)

- [IMPLEMENTATION\_SUMMARY.md](IMPLEMENTATION_SUMMARY.md) - Implementation details
- [REQUIREMENTS.md](REQUIREMENTS.md) - Package requirements
- [TEST\_SUITE\_SUMMARY.md](TEST_SUITE_SUMMARY.md) - Test documentation

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance84

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 76.6% 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

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117408?v=4)[Azahari Zaman](/maintainers/azaharizaman)[@azaharizaman](https://github.com/azaharizaman)

---

Top Contributors

[![azaharizaman](https://avatars.githubusercontent.com/u/117408?v=4)](https://github.com/azaharizaman "azaharizaman (461 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (139 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/azaharizaman-nexus-manufacturing/health.svg)

```
[![Health](https://phpackages.com/badges/azaharizaman-nexus-manufacturing/health.svg)](https://phpackages.com/packages/azaharizaman-nexus-manufacturing)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

515139.2M711](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k54](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k46](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M221](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

367116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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