3neti/wallet

Custom wallet for X-Change

Maintainers

Package info

github.com/3neti/wallet

pkg:composer/3neti/wallet

Statistics

Installs: 59

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-04-10 03:50 UTC

This package is auto-updated.

Last update: 2026-04-10 03:51:43 UTC


README

A lightweight helper package that extends and standardizes usage of Bavix Laravel Wallet within the x-change ecosystem.

๐Ÿงญ Overview

3neti/wallet is not a wallet implementation.

Instead, it provides:

  • Configuration standardization
  • System user handling
  • Integration glue for x-change services (voucher, cash, settlement)
  • Test scaffolding for wallet-based flows

It builds on top of:

  • bavix/laravel-wallet

๐Ÿง  Design Philosophy

This package does NOT own the wallet schema.

All database tables (wallets, transactions, transfers) are owned by:

  • bavix/laravel-wallet

This package focuses on:

  • orchestration
  • consistency
  • extensibility

๐Ÿ“ฆ Installation

composer require 3neti/wallet

โš™๏ธ Configuration

Publish config files:

php artisan vendor:publish --tag=config

Files

  • config/wallet.php
  • config/account.php

๐Ÿ‘ค System User

The package introduces a system user abstraction.

Config

'account' => [
    'system_user' => [
        'identifier' => env('SYSTEM_USER_ID', 'system@example.com'),
        'identifier_column' => 'email',
        'model' => App\Models\User::class,
    ],
]

Purpose

  • acts as source of funds
  • supports top-ups, disbursements, internal transfers

๐Ÿ”„ Integration Role in x-change

Voucher โ†’ Cash โ†’ Wallet โ†’ Settlement

Wallet is responsible for:

  • balance tracking
  • transfers
  • transaction recording

๐Ÿงช Testing Strategy

This package:

  • does NOT ship migrations
  • uses dependency migrations from Bavix

Test Setup

  • loads:
    • test user migration
    • Bavix wallet migrations dynamically

Key Principle

Ownership != Dependency
  • Bavix owns schema
  • Wallet package depends on it

๐Ÿ—๏ธ Service Provider

LBHurtado\Wallet\WalletServiceProvider

Responsibilities

  • merge configs
  • register event provider
  • expose configuration

๐Ÿ”Œ Dependencies

  • bavix/laravel-wallet
  • spatie/laravel-data
  • lorisleiva/laravel-actions
  • brick/money

โš ๏ธ Important Notes

โŒ Do NOT:

  • copy Bavix migrations into this package
  • publish Bavix migrations from here
  • override wallet tables

โœ… DO:

  • treat wallet as infrastructure
  • extend behavior via services/actions
  • keep this package stateless

๐Ÿง  Architectural Role

This package is part of the financial core layer:

[Contact] โ†’ [Voucher] โ†’ [Cash] โ†’ [Wallet] โ†’ [Settlement]

Wallet sits at:

๐Ÿ‘‰ value storage + transfer layer

๐Ÿš€ Future Extensions

  • multi-account support
  • audit enhancements
  • event-driven hooks
  • reconciliation support

๐Ÿง  Final Thought

This package does not implement wallets.
It ensures wallets behave correctly within x-change.

License

MIT