bavix/laravel-wallet
bavix/laravel-wallet is a Laravel package for working with virtual wallets, supporting transactions, deposits, withdrawals, and multi-wallet setups with a documented API.
deposit/withdraw/transfer model. One adoption unlocks several roadmap items without re-architecting each one.Customer/ProductInterface model (plus ProductLimitedInterface for one-time or inventory-constrained purchases, and PurchaseQueryHandlerInterface to check "already bought?") directly supports digital goods, one-time unlocks, and entitlement checks — and refund() makes the reversal path a first-class operation rather than a custom job.forceWithdraw() allows a negative balance, which maps to "bill me later," tax/fee collection, or overdraft-style products. That's a product policy decision this package lets you test quickly instead of blocking on infrastructure.uuid extension) let you offer "bonus credits that expire" vs. "real balance," or separate currencies, without a second system. The swap extension covers simple exchange-rate scenarios.brick/math behind the scenes, and balanceFloat/depositFloat handle presentation. This lets you commit to a currency precision policy (including zero-decimal currencies) without float-rounding bugs reaching customers.meta (description, product title) give support and finance a reconciliation trail. It also makes "can we answer a customer dispute in under 5 minutes?" a yes.Adopt when:
WALLET_* env vars.Look elsewhere or build deliberately when:
swap extension sets rates; it is not a treasury system.migrations table bookkeeping.Diligence checklist before committing: pin to a major version and read its upgrade guide; verify the lock/cache driver configuration against your infrastructure; decide the currency-precision policy up front; confirm your PSP integration writes wallet entries only after settlement; and wrap the package behind a thin domain interface so a future migration isn't a rewrite.
For executives (one paragraph): We need balances, credits, refunds, and "pay with balance" for several roadmap items. Building that correctly means ledger design, concurrency safety, and an audit trail — roughly a quarter of engineering plus ongoing accounting risk. bavix/laravel-wallet is an MIT-licensed Laravel package that already provides this: about 1,300 GitHub stars, active releases, published documentation, a public benchmark, and a stated support window through September 2028 on current Laravel and PHP versions. It handles the correctness-critical part — atomic transactions, locking, refunds, transfers, and integer-based money math — so our engineers build the product experience instead of re-deriving accounting edge cases. The trade-offs are honest: it is backend-only (no admin UI), it is maintained by a small team with community support rather than a vendor SLA, it does not move real money (we still need our payment provider), and its third-party adoption signal is thin enough that we should validate it in a bounded pilot before betting a revenue-critical flow on it.
For engineering (the short version): Drop-in HasWallet/CanPay traits and Wallet/Customer/ProductInterface contracts, migrations included, configurable lock and cache drivers, brick/math under the hood, PHPStan-friendly typed APIs, and extensions for UUID keys, exchange rates, and balance warm-up. Refunds, safePay, purchase-query checks, and multi-wallet are first-class. Known costs: schema/index footprint (recent releases trimmed redundant indexes — plan the migration, and use online schema change tooling on large tables), a disciplined major-version upgrade path, and single-service coupling. Proposal: two-week spike behind a domain interface, covering deposit/withdraw/transfer/refund plus a concurrency test, then a decision.
How can I help you explore Laravel packages today?