- What is 021/laravel-wallet used for?
- It is a Laravel package for adding wallet functionality to an application. It lets you manage multiple balances, credit and debit funds, record transactions, handle deposits, withdrawals, and transfers, and track wallet history through an Eloquent-friendly API.
- How do I install 021/laravel-wallet?
- Install it with Composer using composer require 021/laravel-wallet, then follow the package docs to publish configuration and migrations and run php artisan migrate. Because the provided overview does not list exact publish tags or service-provider steps, verify the install commands in the repository README before adopting it. Pin the package version in composer.json and test in a non-production environment first.
- Can I manage multiple wallet balances per user with 021/laravel-wallet?
- The package is described as supporting multiple balances, so it is intended for apps where an owner may need more than one wallet or balance. The exact ownership model, such as polymorphic wallet ownership or tenant scoping, is not confirmed in the provided overview. Review the migrations and model relationships before mapping users, teams, or accounts to wallets.
- Does 021/laravel-wallet support deposits, withdrawals, and transfers?
- Yes, the package overview explicitly lists deposits, withdrawals, and transfers alongside crediting, debiting, transaction recording, and wallet history. Treat these as building blocks and implement your own business rules, authorization, limits, and review flows around them. Test transfer and withdrawal failure paths before production.
- Is 021/laravel-wallet safe to use as a production financial ledger?
- Treat it as an accelerator, not an audited ledger. The TPM assessment notes limited production evidence, with 277 GitHub stars and 0 dependents, and highlights financial-correctness risks such as race conditions, double-spend prevention, decimal precision, rounding, idempotency, isolation, and auditability. Require a proof of concept with concurrency, idempotency, and failure-injection tests before relying on it for real money.
- Which Laravel and PHP versions does 021/laravel-wallet support?
- The provided overview does not specify supported Laravel, PHP, or database versions. Check the package composer.json, release notes, and test matrix, then pin a version that matches your Laravel and PHP runtime. Also verify compatibility with MySQL or PostgreSQL, queues, and UUID or integer keys.
- How does 021/laravel-wallet prevent double-spending and race conditions?
- The overview does not document the locking, transaction isolation, or idempotency semantics needed to answer that safely. The TPM assessment lists atomic debit and credit operations, database locking, and idempotency keys as key questions to verify. Run concurrent debit and transfer tests against your database before trusting it with balances.
- Can I migrate existing wallet balances into 021/laravel-wallet?
- Brownfield migration is higher risk because existing balances, historical ledgers, reconciliation, and authorization models must be mapped carefully. Build a one-time backfill and reconciliation process, and prefer a shadow-ledger comparison before switching production traffic. Avoid uncontrolled dual-write unless you have a reconciliation ledger and a clear cutover plan.
- Does 021/laravel-wallet support multi-tenancy, audit trails, and domain events?
- The provided material does not confirm multi-tenancy, audit-trail, reconciliation-hook, or domain-event support. The TPM assessment recommends testing tenant scoping and authorization boundaries and keeping the package behind an internal WalletService or repository interface. If you need audit or event streams, add them at the application layer or verify package support before committing.
- Should I fork 021/laravel-wallet or build my own wallet ledger?
- The package is MIT licensed, which reduces legal friction, but its small ecosystem and 0 dependents mean you should budget for internal ownership and possible forking. Use it if its Eloquent-friendly API and transaction features fit your supporting-domain needs and pass your concurrency and reconciliation tests. If wallets are core to regulated or high-throughput finance, evaluate a purpose-built ledger or an internal design with stronger audit guarantees.