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

ActiveLibrary[Payment Processing](/categories/payments)

krunaldodiya/wallet
===================

laravel wallet

1.1.3(2y ago)044MITPHPPHP ^8.1

Since Dec 24Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (14)Used By (0)

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

[](#laravel-wallet)

In a few projects I had to implement a virtual currency. The user would buy packs of credits with Stripe and then use them in the app in exchange of services or goods. This package is a small and simple implementation of this concept with place for customization.

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

[](#installation)

Install the package with composer:

```
composer require krunaldodiya/wallet
```

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

[](#run-migrations)

Publish the migrations with this artisan command:

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

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

[](#configuration)

You can publish the config file with this artisan command:

```
php artisan vendor:publish --provider="KD\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 KD\Wallet\Traits\HasWallet;

class User extends Model
{
    use HasWallet;

    ...
}
```

Then you can easily make transactions from your user model.

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

$transaction = $user->createTransaction(100, 'deposit', ['description' => 'transaction description'])
$user->deposit($transaction->transaction_id);
$user->balance; // 100

$transaction = $user->createTransaction(50, 'withdraw', ['description' => 'transaction description'])
$user->withdraw($transaction->transaction_id);
$user->balance; // 50

$transaction = $user->createTransaction(200, 'withdraw', ['description' => 'transaction description'])
$user->forceWithdraw($transaction->transaction_id);
$user->balance; // -150
```

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Krunal Dodiya](https://github.com/krunaldodiya)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Recently: every ~137 days

Total

13

Last Release

1051d ago

### Community

Maintainers

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

---

Top Contributors

[![krunaldodiya](https://avatars.githubusercontent.com/u/7272013?v=4)](https://github.com/krunaldodiya "krunaldodiya (12 commits)")

---

Tags

laravelwalletkrunaldodiya

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[021/laravel-wallet

Reliable and flexible wallet system for Laravel

2785.2k](/packages/021-laravel-wallet)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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