PHPackages                             ronappleton/laravel-wallet - 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. ronappleton/laravel-wallet

ActiveLibrary

ronappleton/laravel-wallet
==========================

Simple wallet system package for laravel

v1.0.6(1y ago)0192MITPHP

Since Mar 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ronappleton/laravel-wallet)[ Packagist](https://packagist.org/packages/ronappleton/laravel-wallet)[ RSS](/packages/ronappleton-laravel-wallet/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

[![laravel_wallet.jpg](laravel_wallet.jpg)](laravel_wallet.jpg)[![](https://camo.githubusercontent.com/aeb1f0cf87a50a396cc0237cb631446afed478c2b7ba3f85096b23da5c8e0a88/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35333066653138656133663336633033383531612f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/ronappleton/laravel-wallet/maintainability)[![](https://camo.githubusercontent.com/2822cdfceff07788630578fb0f65089c659b914bea27af96200060be7f66ce9e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35333066653138656133663336633033383531612f746573745f636f766572616765)](https://codeclimate.com/github/ronappleton/laravel-wallet/test_coverage)

Laravel Wallet
==============

[](#laravel-wallet)

Introduction
------------

[](#introduction)

Laravel Wallet is a configurable wallet system for platform transaction management, it has nothing to do with payment providers or the crediting of funds.

If you provide a platform that uses micro transactions between users and other entities then this package can help facilitate that whilst recording those transactions.

Potential Uses:

- Points System
- Store Credit
- Currency Trading
- Gamification
- Gift Balances
- Subscriptions
- Reward Systems
- ...

The package is configurable to allow for adoption into existing platforms and for good control of an implementation within a new platform.

### Feature List

[](#feature-list)

- Multiple Currencies
- Multiple Wallets Per Entity
- Single Currency Wallet Locking
- Depositing of funds into Wallets
- Withdrawal of funds from Wallets
- Transferring of funds between Wallets
- Full Transaction Logging
- Transaction Events
- Wallet Metadata

### Configurable Options

[](#configurable-options)

- Set models for Wallet and Wallet Transactions
- Use of Uuids or Integers for record ids (Uuids recommended)
- Allow negative balances (not recommended)
- Locking of wallets to one per currency per entity
- Set wallet and wallet transactions table names

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

[](#installation)

```
composer require ronappleton/laravel-wallet
```

The package is automatically registered and discovered.

Usage
-----

[](#usage)

A trait is provided `Appleton\LaravelWallet\Models\Concerns\HasWallets`

Use the trait in any models like `User` that you want to have wallets.

You can then use `User::createWallet(string|BackedEnum $currency)` to create a new wallet for the user. If the user already has a wallet for the currency, and the setting `one_wallet_per_currency` is true, a `WalletExists` exception will be thrown.

You can use the currency column in a couple of ways:

- To record the wallet type, for example: Points (for loyalty points etc.)
- To record the currency, for example: USD, GBP, EUR
- To record cryptocurrency, for example: BTC, ETH, LTC

This ensures you can use the system for multiple purposes within the same installation.

Wallets cannot be either updated, nor deleted. This ensures consistency in data recording i.e. transactions.

Transactions cannot be update, nor deleted. Again this is for consistency in data recording.

You can as you would imagine call `balance` on a wallet model, the balance will always be calculated from the transactions table.

This means you may find performance degradation over time and is why you can configure the wallet and wallet transaction models via config, so you can tune your approach.

### Moving funds

[](#moving-funds)

There is 3 methods on the Wallet Model related to moving funds about:

- deposit(float $amount, array $meta = \[\])
- withdrawal(float $amount, array $meta = \[\])
- transfer(Wallet $wallet, float $amount, array $meta = \[\], ?CurrencyConverter $converter = null)

You will notice the array `$meta` parameter to each method.

This is provided for you to add any extra information you may need to record.

```
@param array $meta
```

It should be noted that the authenticated user will automatically be recorded.

You will also notice the `CurrencyConverter` parameter of the transfer method.

Understandably you may need to convert currencies/points etc.

`CurrencyConverter` is an interface within the package that allows you to pass a converter to the method to allow for conversion. The contract sets out the methods required for the package to manage the conversions automatically. The conversion metadata is also recorded automatically, recording the currencies converted between, the rate used and the converter used.

### Events

[](#events)

There are two events within the package that you can listen for:

- `Appleton\LaravelWallet\Events\TransactionStartEvent`
- `Appleton\LaravelWallet\Events\TransactionCompletedEvent`

The first event is dispatched when a transaction is started.

This event could be used to run fraud checks etc prior to the transaction being completed.

The second event is dispatched when a transaction is completed.

This event could be used to email a user details of the transaction for example, or maybe you charge commission on transfers, or for currency conversion and so on, a listener could be used to then create those charges.

Both events are fired during every transaction, deposit, withdrawal and transfer.

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Recently: every ~2 days

Total

7

Last Release

653d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e2afdd94a6f21a4ec2c5df569b80c1d47d6f5d0428f866f55c4bc117856b58b?d=identicon)[Ron Appleton](/maintainers/Ron%20Appleton)

---

Top Contributors

[![ronappleton](https://avatars.githubusercontent.com/u/3792420?v=4)](https://github.com/ronappleton "ronappleton (24 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ronappleton-laravel-wallet/health.svg)

```
[![Health](https://phpackages.com/badges/ronappleton-laravel-wallet/health.svg)](https://phpackages.com/packages/ronappleton-laravel-wallet)
```

PHPackages © 2026

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