PHPackages                             3neti/merchant - 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. 3neti/merchant

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

3neti/merchant
==============

Merchant and vendor-alias helper utilities for x-change

v1.1.0(2mo ago)029↓90%2proprietaryPHPPHP ^8.2

Since Mar 26Pushed 2mo agoCompare

[ Source](https://github.com/3neti/merchant)[ Packagist](https://packagist.org/packages/3neti/merchant)[ RSS](/packages/3neti-merchant/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (15)Versions (3)Used By (2)

3neti/merchant
==============

[](#3netimerchant)

A lightweight Merchant and Vendor Alias management package designed to support the **x-change** financial workflow platform.

---

🧭 Overview
----------

[](#-overview)

`3neti/merchant` provides a minimal, focused domain layer for:

- Merchant management
- Vendor alias assignment and validation
- Reserved alias protection
- Clean integration with Laravel applications

It is intentionally **small, strict, and domain-focused**, making it ideal as a supporting package in larger financial systems like x-change.

---

🎯 Core Concepts
---------------

[](#-core-concepts)

### Merchant

[](#merchant)

Represents a business entity that can:

- Own vendor aliases
- Act as a payable / routing identity
- Be linked to a user

### Vendor Alias

[](#vendor-alias)

A short, human-readable identifier used for:

- Payment routing
- Merchant identification
- External references

Example:

```
GCASH
SHOP123
VNDR01

```

---

⚙️ Features
-----------

[](#️-features)

### ✅ Merchant Model

[](#-merchant-model)

- Eloquent model with factory support
- Basic fillable attributes
- User ↔ Merchant relationship support

### ✅ Vendor Alias Service

[](#-vendor-alias-service)

Handles:

#### Normalization

[](#normalization)

```
$alias = $service->normalize(' shop1 ');
// SHOP1
```

#### Validation Rules

[](#validation-rules)

- ASCII only
- Must start with a letter (A–Z)
- Length: 3–8 characters
- Uppercase letters and digits only

```
$service->validate('SHOP1'); // true
$service->validate('shop');  // false
```

#### Availability Checks

[](#availability-checks)

- Prevents duplicate aliases
- Prevents use of reserved aliases

```
$service->isAvailable('SHOP1');
```

---

### ✅ Validation Rule: `ValidVendorAlias`

[](#-validation-rule-validvendoralias)

Laravel validation rule enforcing:

- Strict format validation (no auto-correction)
- Reserved alias protection
- Configurable length limits

```
use LBHurtado\Merchant\Rules\ValidVendorAlias;

$request->validate([
    'alias' => ['required', new ValidVendorAlias],
]);
```

---

🔒 Design Philosophy
-------------------

[](#-design-philosophy)

### 1. Strict Input Validation

[](#1-strict-input-validation)

Aliases are **not auto-corrected**.

- `shop` ❌ invalid
- `SHOP` ✅ valid

This ensures:

- Predictability
- Consistency
- Financial safety

---

### 2. Separation of Concerns

[](#2-separation-of-concerns)

ResponsibilityLayerNormalizationServiceValidationRulePersistenceDatabaseBusiness logicApplication---

### 3. Financial-System Ready

[](#3-financial-system-ready)

Designed for:

- Payment routing
- Payable identities
- Voucher / Pay Code systems

---

🧪 Test Coverage
---------------

[](#-test-coverage)

All tests passing:

```
Tests: 25 passed (58 assertions)

```

### Covered Areas

[](#covered-areas)

- Merchant model
- User ↔ Merchant relationship
- Alias normalization
- Alias validation (valid + invalid cases)
- ASCII enforcement
- Length constraints
- Reserved alias handling
- Error messaging

---

🧱 Database Tables
-----------------

[](#-database-tables)

### `vendor_aliases`

[](#vendor_aliases)

Stores assigned aliases.

### `reserved_vendor_aliases`

[](#reserved_vendor_aliases)

Stores protected aliases (e.g. system, EMI, brands).

Example:

aliasreasonADMINSystemROOTSystemGCASHEMI---

⚙️ Configuration
----------------

[](#️-configuration)

```
// config/merchant.php

'alias' => [
    'min_length' => 3,
    'max_length' => 8,
    'pattern' => '^[A-Z][A-Z0-9]{2,7}$',
],
```

---

🚀 Usage
-------

[](#-usage)

### Assign Alias

[](#assign-alias)

```
$service = new VendorAliasService;

if ($service->isAvailable('SHOP1')) {
    // assign alias
}
```

---

### Validate Input

[](#validate-input)

```
$request->validate([
    'alias' => ['required', new ValidVendorAlias],
]);
```

---

🧭 Role in x-change
------------------

[](#-role-in-x-change)

In the x-change architecture, this package provides:

- Merchant identity layer
- Vendor alias routing key
- Integration point for payable flows

Flow:

```
User → Merchant → Vendor Alias → Voucher / Pay Code → Disbursement

```

---

📌 Key Takeaways
---------------

[](#-key-takeaways)

- This package is intentionally **simple and strict**
- It enforces **clean, uppercase, deterministic identifiers**
- It is built for **financial-grade systems**, not loose UX inputs

---

🔥 Future Enhancements (Optional)
--------------------------------

[](#-future-enhancements-optional)

- Alias assignment actions
- Merchant profile DTOs
- Alias → Merchant resolver service
- Integration with voucher payable specifications

---

📄 License
---------

[](#-license)

Proprietary / Internal Use

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance86

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

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

Total

2

Last Release

74d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/586e1ed70140038e6348728222adbcf68bfc4455b1f94a4f8bcbe57917a63d57?d=identicon)[3neti](/maintainers/3neti)

---

Top Contributors

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

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/3neti-merchant/health.svg)

```
[![Health](https://phpackages.com/badges/3neti-merchant/health.svg)](https://phpackages.com/packages/3neti-merchant)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

9782.1M161](/packages/laravel-ai)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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