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

ActiveLibrary[Payment Processing](/categories/payments)

evinkuraga/laravel-wallet
=========================

Easy work with virtual wallet.

6.3.0(4y ago)032MITPHPPHP ^7.3|^8.0

Since Nov 7Pushed 4y agoCompare

[ Source](https://github.com/evinkuraga/laravel-wallet)[ Packagist](https://packagist.org/packages/evinkuraga/laravel-wallet)[ Docs](https://bavix.github.io/laravel-wallet/)[ RSS](/packages/evinkuraga-laravel-wallet/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (16)Versions (71)Used By (0)

[![Laravel Wallet](https://user-images.githubusercontent.com/5111255/48687709-a7c2fa00-ebd3-11e8-8714-c4f3efe93f02.png)](https://user-images.githubusercontent.com/5111255/48687709-a7c2fa00-ebd3-11e8-8714-c4f3efe93f02.png)

[![Maintainability](https://camo.githubusercontent.com/5fedf4b58599626a944c512f13e60caf9c77c354ca68004156a327e78c26241e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35383834303066356634306362626633613861622f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/bavix/laravel-wallet/maintainability)[![Test Coverage](https://camo.githubusercontent.com/19692b83d5ba6e4599a819d5365a6717755cd45955507c0bc80b89ec4b84c8b2/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35383834303066356634306362626633613861622f746573745f636f766572616765)](https://codeclimate.com/github/bavix/laravel-wallet/test_coverage)[![Financial Contributors on Open Collective](https://camo.githubusercontent.com/b727255cd9d74d19050d4f8481c66562f99914e667594680e13da28c869ad12b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f616c6c2f62616467652e7376673f6c6162656c3d66696e616e6369616c2b636f6e7472696275746f7273)](https://opencollective.com/laravel-wallet) [![Mutation testing badge](https://camo.githubusercontent.com/539d6f4fedad33ec1ecf50884a1649b92b9998c022871e6e438462bf8e32b5f0/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f62617669782f6c61726176656c2d77616c6c65742f6d6173746572)](https://packagist.org/packages/bavix/laravel-wallet)

[![Package Rank](https://camo.githubusercontent.com/40f1207a8445225febc80032460d45ca2e40e123ae06ccbdd06f534b686548b8/68747470733a2f2f7068707061636b616765732e6f72672f702f62617669782f6c61726176656c2d77616c6c65742f62616467652f72616e6b2e737667)](https://packagist.org/packages/bavix/laravel-wallet)[![Latest Stable Version](https://camo.githubusercontent.com/61865f74314f89bcb84aa796dfb4dc1754d72a155d7d76dcd897389bd9d8268c/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d77616c6c65742f76)](https://packagist.org/packages/bavix/laravel-wallet)[![Latest Unstable Version](https://camo.githubusercontent.com/16905de8dc2edf3ec6223429da4be9937e9f6d2af3cb2b56ad12bafe675d15ea/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d77616c6c65742f762f756e737461626c65)](https://packagist.org/packages/bavix/laravel-wallet)[![License](https://camo.githubusercontent.com/6de443f6f31da5e3143cbe8c9536b1b3ed9978267ce792c57d05d738e59d3def/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d77616c6c65742f6c6963656e7365)](https://packagist.org/packages/bavix/laravel-wallet)[![composer.lock](https://camo.githubusercontent.com/9e96f0e03e71258c398eda14d460dd93dc0921392639aef41c855c4691425fa4/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d77616c6c65742f636f6d706f7365726c6f636b)](https://packagist.org/packages/bavix/laravel-wallet)

[![Sparkline](https://camo.githubusercontent.com/ba5628df4d0cd1d49f7a78d80ab9852742a907dcb26d87a77fc60adad58a2da0/68747470733a2f2f73746172732e6d6564762e696f2f62617669782f6c61726176656c2d77616c6c65742e737667)](https://stars.medv.io/bavix/laravel-wallet)

laravel-wallet - Easy work with virtual wallet.

\[[Documentation](https://bavix.github.io/laravel-wallet/)\] \[[Get Started](https://bavix.github.io/laravel-wallet/#/basic-usage)\]

\[[Документация](https://bavix.github.io/laravel-wallet/#/ru/)\] \[[Как начать](https://bavix.github.io/laravel-wallet/#/ru/basic-usage)\]

- **Vendor**: bavix
- **Package**: laravel-wallet
- **Version**: [![Latest Stable Version](https://camo.githubusercontent.com/61865f74314f89bcb84aa796dfb4dc1754d72a155d7d76dcd897389bd9d8268c/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d77616c6c65742f76)](https://packagist.org/packages/bavix/laravel-wallet)
- **PHP Version**: 7.3+ (if you are using version 5.x then 7.2+)
- **Laravel Version**: `5.5`, `5.6`, `5.7`, `5.8`, `6.x`, `7.x`, `8.x`
- **[Composer](https://getcomposer.org/):** `composer require bavix/laravel-wallet`

### Upgrade Guide

[](#upgrade-guide)

> Starting with version 5.x, support for Laravel 5 has been discontinued. Update laravel or use version 4.x.

To perform the migration, you will be [helped by the instruction](https://bavix.github.io/laravel-wallet/#/upgrade-guide).

### Extensions

[](#extensions)

ExtensionDescription[Swap](https://github.com/bavix/laravel-wallet-swap)Addition to the laravel-wallet library for quick setting of exchange rates[Vacuum](https://github.com/bavix/laravel-wallet-vacuum)Addition to the laravel-wallet library for quick fix race condition> Since version 6.2 the Vacuum package is built in and no longer requires additional steps.

### Usage

[](#usage)

Add the `HasWallet` trait and `Wallet` interface to model.

```
use Bavix\Wallet\Traits\HasWallet;
use Bavix\Wallet\Interfaces\Wallet;

class User extends Model implements Wallet
{
    use HasWallet;
}
```

Now we make transactions.

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

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

$user->withdraw(1);
$user->balance; // 9

$user->forceWithdraw(200, ['description' => 'payment of taxes']);
$user->balance; // -191
```

### Purchases

[](#purchases)

Add the `CanPay` trait and `Customer` interface to your `User` model.

```
use Bavix\Wallet\Traits\CanPay;
use Bavix\Wallet\Interfaces\Customer;

class User extends Model implements Customer
{
    use CanPay;
}
```

Add the `HasWallet` trait and `Product` interface to `Item` model.

```
use Bavix\Wallet\Traits\HasWallet;
use Bavix\Wallet\Interfaces\Product;
use Bavix\Wallet\Interfaces\Customer;

class Item extends Model implements Product
{
    use HasWallet;

    public function canBuy(Customer $customer, int $quantity = 1, bool $force = false): bool
    {
        /**
         * If the service can be purchased once, then
         *  return !$customer->paid($this);
         */
        return true;
    }

    public function getAmountProduct(Customer $customer)
    {
        return 100;
    }

    public function getMetaProduct(): ?array
    {
        return [
            'title' => $this->title,
            'description' => 'Purchase of Product #' . $this->id,
        ];
    }

    public function getUniqueId(): string
    {
        return (string)$this->getKey();
    }
}
```

Proceed to purchase.

```
$user = User::first();
$user->balance; // 100

$item = Item::first();
$user->pay($item); // If you do not have enough money, throw an exception
var_dump($user->balance); // 0

if ($user->safePay($item)) {
  // try to buy again )
}

var_dump((bool)$user->paid($item)); // bool(true)

var_dump($user->refund($item)); // bool(true)
var_dump((bool)$user->paid($item)); // bool(false)
```

### Eager Loading

[](#eager-loading)

```
User::with('wallet');
```

### How to work with fractional numbers?

[](#how-to-work-with-fractional-numbers)

Add the `HasWalletFloat` trait and `WalletFloat` interface to model.

```
use Bavix\Wallet\Traits\HasWalletFloat;
use Bavix\Wallet\Interfaces\WalletFloat;
use Bavix\Wallet\Interfaces\Wallet;

class User extends Model implements Wallet, WalletFloat
{
    use HasWalletFloat;
}
```

Now we make transactions.

```
$user = User::first();
$user->balance; // 100
$user->balanceFloat; // 1.00

$user->depositFloat(1.37);
$user->balance; // 237
$user->balanceFloat; // 2.37
```

---

Supported by

[![Supported by JetBrains](https://camo.githubusercontent.com/426b71c1485422e61c59d8b7fec03f4ba626dd77443847c0a14053491eb8fc4a/68747470733a2f2f63646e2e7261776769742e636f6d2f62617669782f646576656c6f706d656e742d7468726f7567682f34363437356234622f6a6574627261696e732e737667)](https://www.jetbrains.com/)

Contributors
------------

[](#contributors)

### Code Contributors

[](#code-contributors)

This project exists thanks to all the people who contribute. \[[Contribute](CONTRIBUTING.md)\]. [![](https://camo.githubusercontent.com/250ed6eb5180c053298850feeabd99e6d1217c9189e49f7e623cd6d09ec76f91/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365)](https://github.com/bavix/laravel-wallet/graphs/contributors)

### Financial Contributors

[](#financial-contributors)

Become a financial contributor and help us sustain our community. \[[Contribute](https://opencollective.com/laravel-wallet/contribute)\]

#### Individuals

[](#individuals)

[![](https://camo.githubusercontent.com/d5ce74091ab4cb617607636e0763d0f4b32e906810ce3ea613d5169023cc355a/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f696e646976696475616c732e7376673f77696474683d383930)](https://opencollective.com/laravel-wallet)

#### Organizations

[](#organizations)

Support this project with your organization. Your logo will show up here with a link to your website. \[[Contribute](https://opencollective.com/laravel-wallet/contribute)\]

[![](https://camo.githubusercontent.com/5834b7d61e27297829672f085b8e777ff63884c016544a3c3a8d68eb34d2ba0f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f302f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/0/website)[![](https://camo.githubusercontent.com/08e45720df4a79db8457fca22f6b935fd8f888dfe0b3f8070dc568eb6cd54e05/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f312f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/1/website)[![](https://camo.githubusercontent.com/3d842fa50f8e5be258b0f91bfb81bcd3e5f2b67785c4a921cc1aae49290d0f6f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f322f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/2/website)[![](https://camo.githubusercontent.com/30031b18d083f8f3616b386cb987ec2539c8171d1a918b52282f51575bda104e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f332f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/3/website)[![](https://camo.githubusercontent.com/38cdd446808c0bb4d2d5178f9ea22da598237bfdfabf5fe22fbb6c15e625fd3c/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f342f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/4/website)[![](https://camo.githubusercontent.com/33ac1da43a20a8252742bd66a4c3086ee98fd7c58a3119a54966d96e4354b306/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f352f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/5/website)[![](https://camo.githubusercontent.com/772f08f44d65506d3e6adf65a7ec013b3622d070d3adf0e22ba52c6b9240e480/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f362f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/6/website)[![](https://camo.githubusercontent.com/74033673aa3fbb7553abde50f4628047e3bb01a34fc1bcff6582db681d250a27/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f372f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/7/website)[![](https://camo.githubusercontent.com/38d04fe3391b51fe11a6f58aad16bd41cff052969430584868313d9991963e06/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f382f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/8/website)[![](https://camo.githubusercontent.com/86131b1a5fe5372a622924e8f2fcd78cee6d55133e852f63ccbd179241926f72/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6c61726176656c2d77616c6c65742f6f7267616e697a6174696f6e2f392f6176617461722e737667)](https://opencollective.com/laravel-wallet/organization/9/website)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94% 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 ~3 days

Total

68

Last Release

1645d ago

Major Versions

4.2.0 → 5.0.02020-03-13

4.2.1 → 5.0.12020-03-19

4.2.2 → 5.0.22020-03-22

5.5.0 → 6.0.02020-11-13

5.5.1 → 6.0.12020-11-18

PHP version history (5 changes)0.0.1PHP ^7.1

3.1.5PHP ^7.1|^8.0

4.0.0PHP ^7.2|^8.0

5.4.0PHP ^7.3|^8.0

6.2.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0895278d07590e28317ad2b90140840b84afe8151d102e8f199183be58c154f1?d=identicon)[evinkuraga](/maintainers/evinkuraga)

---

Top Contributors

[![rez1dent3](https://avatars.githubusercontent.com/u/5111255?v=4)](https://github.com/rez1dent3 "rez1dent3 (656 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (15 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![cispl-shaswatad](https://avatars.githubusercontent.com/u/59719293?v=4)](https://github.com/cispl-shaswatad "cispl-shaswatad (2 commits)")[![omarhen](https://avatars.githubusercontent.com/u/5448144?v=4)](https://github.com/omarhen "omarhen (1 commits)")[![reedknight](https://avatars.githubusercontent.com/u/9690079?v=4)](https://github.com/reedknight "reedknight (1 commits)")[![moecasts](https://avatars.githubusercontent.com/u/37169906?v=4)](https://github.com/moecasts "moecasts (1 commits)")[![akhedrane](https://avatars.githubusercontent.com/u/297340?v=4)](https://github.com/akhedrane "akhedrane (1 commits)")[![hsharghi](https://avatars.githubusercontent.com/u/2873823?v=4)](https://github.com/hsharghi "hsharghi (1 commits)")[![adriangonzales](https://avatars.githubusercontent.com/u/486071?v=4)](https://github.com/adriangonzales "adriangonzales (1 commits)")[![monkeywithacupcake](https://avatars.githubusercontent.com/u/7316730?v=4)](https://github.com/monkeywithacupcake "monkeywithacupcake (1 commits)")

---

Tags

laravelcurrencylaravel-packagepaymentswalletvirtualcreditslaravel-walletevinkuraga

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[bavix/laravel-wallet

It's easy to work with a virtual wallet.

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

Addition to the package laravel-wallet.

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

Easy to use virtual wallet for your app

4310.6k](/packages/mannikj-laravel-wallet)[depsimon/laravel-wallet

Easy to use virtual wallet for your app

9521.6k1](/packages/depsimon-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)
