PHPackages                             mannikj/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. [Payment Processing](/categories/payments)
4. /
5. mannikj/laravel-wallet

ActiveLibrary[Payment Processing](/categories/payments)

mannikj/laravel-wallet
======================

Easy to use virtual wallet for your app

v11.3.0(2mo ago)4310.6k↓31.6%14[2 issues](https://github.com/MannikJ/laravel-wallet/issues)MITPHPPHP ^8.2

Since Feb 22Pushed 2mo ago6 watchersCompare

[ Source](https://github.com/MannikJ/laravel-wallet)[ Packagist](https://packagist.org/packages/mannikj/laravel-wallet)[ Docs](https://github.com/mannikj/laravel-wallet)[ RSS](/packages/mannikj-laravel-wallet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (31)Used By (0)

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

[](#laravel-wallet)

Some apps require a prepayment system like a virtual wallet where customers can recharge credits which they can then use to pay in app stuff. With this package you can equip your eloquent models with a digital wallet that handle that for you. All the wallet activities are tracked with transactions.

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

[](#installation)

Install the package with composer:

```
composer require mannikj/laravel-wallet
```

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

[](#run-migrations)

Per default the package will automatically load the migrations from the vendor folder.

If you want more flexibility, you can publish the migration files to your own migration directory with the following artisan command:

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

Make sure to deactivate automatic migration loadingby setting the config variable `load_migrations` to false when you have published the migration file.

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

[](#configuration)

You can publish the config file with this artisan command:

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

This will merge the `wallet.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 MannikJ\Laravel\Wallet\Traits\HasWallet;

class User extends Model
{
    use HasWallet;

    ...
}
```

Then you can easily make transactions from your user model.

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

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

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

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

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

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

Testing
-------

[](#testing)

This package makes use of  to create a laravel testing environment. The tests will execute with a pre-configured in-memory sqlite database, so you don't need setup a database on your own.

To run the phpunit tests just make sure to install the package dependencies first via

`composer install`

Then execute from within the project root directory

`composer test`

Security
--------

[](#security)

If you discover any security related issues, open an issue on the [github repository](https://github.com/MannikJ/laravel-wallet/issues).

Credits
-------

[](#credits)

- [Simon Depelchin](https://github.com/depsimon) (forked from [despimon/laravel-wallet](https://github.com/depsimon/laravel-wallet))
- [MannikJ](https://github.com/mannikj)

License
-------

[](#license)

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

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 89.7% 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 ~108 days

Recently: every ~146 days

Total

28

Last Release

89d ago

Major Versions

v5.0.0 → v6.0.02021-08-06

v6.2.0 → v7.0.02022-03-17

v7.0.0 → v9.0.02022-05-11

v9.0.0 → v10.0.02023-03-06

v10.1.0 → v11.0.02024-07-01

PHP version history (7 changes)v1.0.0PHP ^7.0

v3.0.0PHP ^7.2

v4.0.0PHP ^7.2.5

v6.0.0PHP ^7.3|^8.0

v7.0.0PHP ^8.0

v10.0.0PHP ^8.1

v11.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0395cab7b59845b773eac21ecdb506c06642c60ab1e10c27d0331a9d7ca249b4?d=identicon)[MannikJ](/maintainers/MannikJ)

---

Top Contributors

[![MannikJ](https://avatars.githubusercontent.com/u/1841856?v=4)](https://github.com/MannikJ "MannikJ (96 commits)")[![depsimon](https://avatars.githubusercontent.com/u/1822289?v=4)](https://github.com/depsimon "depsimon (9 commits)")[![chadtomkiss](https://avatars.githubusercontent.com/u/1034152?v=4)](https://github.com/chadtomkiss "chadtomkiss (1 commits)")[![tolawho](https://avatars.githubusercontent.com/u/12527881?v=4)](https://github.com/tolawho "tolawho (1 commits)")

---

Tags

currencypaymentwalletvirtualcreditslaravel-walletdepsimonmannikj

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[depsimon/laravel-wallet

Easy to use virtual wallet for your app

9521.6k1](/packages/depsimon-laravel-wallet)[bavix/laravel-wallet-swap

Addition to the package laravel-wallet.

2427.2k](/packages/bavix-laravel-wallet-swap)[021/laravel-wallet

Reliable and flexible wallet system for Laravel

2785.2k](/packages/021-laravel-wallet)

PHPackages © 2026

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