PHPackages                             obelaw/ium-pos - 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. obelaw/ium-pos

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

obelaw/ium-pos
==============

POS Module for Obelawium ERP

120PHP

Since Jun 11Pushed 1mo agoCompare

[ Source](https://github.com/obelawium/pos)[ Packagist](https://packagist.org/packages/obelaw/ium-pos)[ RSS](/packages/obelaw-ium-pos/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Obelawium IUM — Pos Module
==========================

[](#obelawium-ium--pos-module)

> Baseline boilerplate for creating isolated pos modules within the Obelawium ERP ecosystem.

Architecture
------------

[](#architecture)

This module enforces **strict pos isolation**. Every pos is a self-contained Laravel package with no direct database cross-queries or model leakages.

```
ium()->pos()->records()->store($data);

```

### Principles

[](#principles)

- **Pos Isolation** — No cross-pos DB queries or Model usage. Communication happens exclusively through Data objects.
- **Data Objects** — All incoming/outgoing payloads live under `Obelaw\Ium\Pos\Data`, providing type-safe, immutable structures.
- **Fluent Pos API** — Each pos registers a macro on `ObelawiumManager`, enabling seamless chaining via the global `ium()` helper.

Directory Structure
-------------------

[](#directory-structure)

```
database/migrations/          # Pos-scoped migrations
src/
  Base/                       # Abstract bases extending ium-core
  Data/                       # Type-safe data/transfer objects
  Models/                     # Eloquent models (never accessed cross-pos)
  Providers/                  # Service provider with macro registration
  Services/                   # Stateless service classes

```

Usage
-----

[](#usage)

### Records

[](#records)

```
$record = RecordData::fromArray([
    'key'   => 'setting_name',
    'value' => 'some_value',
    'options' => ['scope' => 'global'],
]);

ium()->pos()->records()->store($record);
```

### Terminals

[](#terminals)

The Terminal Service manages POS terminals with support for staff assignment, status management, and polymorphic terminalable relationships.

#### Creating Terminals

[](#creating-terminals)

Terminals must be created using the `TerminalData` DTO for type safety and validation:

```
use Obelaw\Ium\Pos\Data\TerminalData;

// Create a simple terminal
$terminalData = new TerminalData(
    name: 'Main Counter',
    status: 'active'
);

$terminal = ium()->pos()->terminal()->create($terminalData);

// Create a terminal with a polymorphic relationship
$store = Store::find(1);
$terminalData = new TerminalData(
    name: 'Main Counter',
    status: 'active',
    terminalable: $store
);

$terminal = ium()->pos()->terminal()->create($terminalData);
```

#### Retrieving Terminals

[](#retrieving-terminals)

```
// Get terminal by ID
$terminal = ium()->pos()->terminal()->getById(1);

// Get terminal by name
$terminal = ium()->pos()->terminal()->getByName('Main Counter');

// Get all terminals
$terminals = ium()->pos()->terminal()->getAll();

// Get terminals paginated
$paginated = ium()->pos()->terminal()->getPaginated(perPage: 20);

// Get terminals by status
$activeTerminals = ium()->pos()->terminal()->getByStatus('active');

// Check if terminal exists
$exists = ium()->pos()->terminal()->exists(1);
```

#### Updating Terminals

[](#updating-terminals)

```
// Update with TerminalData (recommended)
$updatedData = new TerminalData(
    name: 'Updated Counter Name',
    status: 'active'
);

ium()->pos()->terminal()->updateFromData($terminal, $updatedData);

// Update raw data
ium()->pos()->terminal()->update($terminal, [
    'name' => 'New Name',
    'status' => 'inactive'
]);
```

#### Status Management

[](#status-management)

```
// Activate a terminal
ium()->pos()->terminal()->activate($terminal);

// Deactivate a terminal
ium()->pos()->terminal()->deactivate($terminal);
```

#### Staff Assignment

[](#staff-assignment)

```
// Assign staff to terminal
$staffId = 5;
ium()->pos()->terminal()->assignStaff($terminal, $staffId);

// Remove staff from terminal
ium()->pos()->terminal()->removeStaff($terminal, $staffId);

// Get all staff assigned to terminal
$staff = ium()->pos()->terminal()->getStaff($terminal);
```

#### Terminalable Relationships

[](#terminalable-relationships)

The terminal supports polymorphic relationships with any model through the `terminalable` association:

```
// Attach terminalable to terminal
$store = Store::find(1);
ium()->pos()->terminal()->attachTerminalable($terminal, $store);

// Update terminalable relationship
$newStore = Store::find(2);
ium()->pos()->terminal()->updateTerminalable($terminal, $newStore);

// Get terminal's terminalable model
$store = ium()->pos()->terminal()->getTerminalable($terminal);

// Check if terminal has terminalable
$hasTerminalable = ium()->pos()->terminal()->hasTerminalable($terminal);

// Detach terminalable from terminal
ium()->pos()->terminal()->detachTerminalable($terminal);
```

#### Related Data

[](#related-data)

```
// Get all sessions for a terminal
$sessions = ium()->pos()->terminal()->getSessions($terminal);
```

#### Deleting Terminals

[](#deleting-terminals)

```
$deleted = ium()->pos()->terminal()->delete($terminal);
```

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

[](#installation)

```
composer require obelaw/ium-pos
```

The service provider is auto-discovered via Laravel's package discovery.

Extending
---------

[](#extending)

To create a new pos module, copy this boilerplate and:

1. Rename the namespace from `Pos` to your pos (e.g. `Pim`, `Wms`).
2. Update `composer.json` with the new package name and namespace.
3. Implement your own `Data`, `Models`, and `Services` following the same isolated patterns.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance60

Regular maintenance activity

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31162701?v=4)[komicho](/maintainers/komicho)[@komicho](https://github.com/komicho)

---

Top Contributors

[![komtcho](https://avatars.githubusercontent.com/u/12757671?v=4)](https://github.com/komtcho "komtcho (5 commits)")

### Embed Badge

![Health badge](/badges/obelaw-ium-pos/health.svg)

```
[![Health](https://phpackages.com/badges/obelaw-ium-pos/health.svg)](https://phpackages.com/packages/obelaw-ium-pos)
```

###  Alternatives

[robicch/jquery-gantt

Twproject Gantt editor is a free online tool for creating and sharing Gantts

2.2k169.0k](/packages/robicch-jquery-gantt)[spatie/lighthouse-php

Run Google Lighthouse using PHP

26861.5k2](/packages/spatie-lighthouse-php)

PHPackages © 2026

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