PHPackages                             anexponent/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. anexponent/laravel-wallet

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

anexponent/laravel-wallet
=========================

A modern Laravel package providing a simple virtual wallet system.

v1.1.0(9mo ago)15MITPHPPHP ^8.1

Since Nov 11Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/anexponent/tgr-laravel-wallet)[ Packagist](https://packagist.org/packages/anexponent/laravel-wallet)[ Docs](https://github.com/anexponent/laravel-wallet)[ RSS](/packages/anexponent-laravel-wallet/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

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

[](#laravel-wallet)

A modern, simple, and flexible virtual wallet system for Laravel.

This package allows you to attach a wallet to any model (usually a User), deposit and withdraw credits, and keep a full transaction history. Ideal for apps where users buy credits or virtual currency to spend on services or goods.

Features
--------

[](#features)

Assign a wallet to any model (User, Member, etc.) Track deposits, withdrawals, refunds, and custom transaction types Transaction metadata for payment references or descriptions Safe balance updates using database transactions Force withdrawals or failed deposits Configurable models for Wallet, Transaction, and User Supports Laravel 9, 10, and 11

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

[](#installation)

Install the package with composer:

```
composer require anexponent/tgr-laravel-wallet
```

The package automatically merges default configuration, so you can start using it immediately.

Run Migrations
--------------

[](#run-migrations)

```
php artisan migrate
```

Publish the migrations with this artisan command:

Optional: You can publish the migrations if you want to customize them:

```
php artisan vendor:publish --provider="Anexponent\Wallet\WalletServiceProvider" --tag=migrations
```

Configuration
-------------

[](#configuration)

Default configuration is already merged automatically. The defaults are:

```
    return [
        'user_model' => App\Models\User::class,
        'wallet_model' => Anexponent\Wallet\Wallet::class,
        'transaction_model' => Anexponent\Wallet\Transaction::class,
    ];
```

Optional: You can publish the config to customize it:

```
php artisan vendor:publish --provider="Anexponent\Wallet\WalletServiceProvider" --tag=config
```

This will merge the `config.php` config file where you can specify the Users, Wallets &amp; Transactions classes if you have custom ones.

Usage
-----

[](#usage)

Add the `HasWallet` trait to your User model.

```
use Anexponent\Wallet\HasWallet;

class User extends Model
{
    use HasWallet;

    ...
}
```

At some point before making transactions, create the user's wallet.

```
$user->wallet()->firstOrCreate([]);
```

Then you can easily make transactions from your user model.

```
$user = User::find(1);
$user->balance; // 0

$user->deposit(100);
$user->balance; // 100

$user->withdraw(50);
$user->balance; // 50

$user->forceWithdraw(200);
$user->balance; // -150
```

You can easily add meta information to the transactions to suit your needs.

```
$user = User::find(1);
$user->deposit(100, 'deposit', ['stripe_source' => 'ch_BEV2Iih1yzbf4G3HNsfOQ07h', 'description' => 'Deposit of 100 credits from Stripe Payment']);
$user->withdraw(10, 'withdraw', ['description' => 'Purchase of Item #1234']);
```

Transactions
------------

[](#transactions)

Retrieve all transactions:

```
$transactions = $user->transactions;
```

Get signed amount

```
$transaction->signed_amount;
```

Each transaction includes: amount type accepted meta (array) balance (after transaction) hash (unique ID)

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Azeez Adesina](https://github.com/anexponent)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance61

Regular maintenance activity

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e235b946e1882217829fb97b46a07da336755d29d89d2bf1dab8ce4346115ca2?d=identicon)[anexponent](/maintainers/anexponent)

---

Top Contributors

[![anexponent](https://avatars.githubusercontent.com/u/15956366?v=4)](https://github.com/anexponent "anexponent (12 commits)")[![runningjack](https://avatars.githubusercontent.com/u/8626279?v=4)](https://github.com/runningjack "runningjack (3 commits)")

---

Tags

laravelmoneywalletcreditsbalancevirtual-currency

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.4M21](/packages/bavix-laravel-wallet)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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