PHPackages                             yemenopensource/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. [Database &amp; ORM](/categories/database)
4. /
5. yemenopensource/laravel-wallet

ActiveLibrary[Database &amp; ORM](/categories/database)

yemenopensource/laravel-wallet
==============================

Laravel wallet is a package with expressive pronounced syntax that provide top-notch development covering deposits, withdrawals, transactions and balances all quite simply.

v1.2.0(2y ago)1230MITPHP

Since Jun 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/YemenOpenSource/laravel-wallet)[ Packagist](https://packagist.org/packages/yemenopensource/laravel-wallet)[ Fund](https://muathye.com)[ RSS](/packages/yemenopensource-laravel-wallet/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (9)Used By (0)

[![Stand With Palestine](https://raw.githubusercontent.com/TheBSD/StandWithPalestine/main/banner-no-action.svg)](https://TheBSD.github.io/StandWithPalestine/)

[![Laravel Wallet](./images/yos-laravel-wallet.svg)](./images/yos-laravel-wallet.svg)

[![Laravel Unit Test](https://github.com/Yemeni-Open-Source/laravel-wallet/actions/workflows/laravel-unit-test.yml/badge.svg)](https://github.com/Yemeni-Open-Source/laravel-wallet/actions/workflows/laravel-unit-test.yml)[![Packagist Downloads](https://camo.githubusercontent.com/f4a93e1ac9c7996deec722b437952ea0ca727d10bfd65cd545e39557763aee86/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f59656d656e692d4f70656e2d536f757263652f6c61726176656c2d77616c6c65743f636f6c6f723d626c7565266c6162656c3d446f776e6c6f616473266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/f4a93e1ac9c7996deec722b437952ea0ca727d10bfd65cd545e39557763aee86/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f59656d656e692d4f70656e2d536f757263652f6c61726176656c2d77616c6c65743f636f6c6f723d626c7565266c6162656c3d446f776e6c6f616473266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)[![Packagist Version](https://camo.githubusercontent.com/e61ecc22adfe69d396f2245046a01afb6d14fe51f05ebe7c8bd8ed7f3f9beed0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f59656d656e692d4f70656e2d536f757263652f6c61726176656c2d77616c6c65743f636f6c6f723d677265656e266c6162656c3d56657273696f6e266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/e61ecc22adfe69d396f2245046a01afb6d14fe51f05ebe7c8bd8ed7f3f9beed0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f59656d656e692d4f70656e2d536f757263652f6c61726176656c2d77616c6c65743f636f6c6f723d677265656e266c6162656c3d56657273696f6e266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)[![GitHub](https://camo.githubusercontent.com/6b4b23271029d5ecc88ffe9465466586616e533fecffe3a3a8672c14c7f92779/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f59656d656e692d4f70656e2d536f757263652f6c61726176656c2d77616c6c65743f6c6f676f3d4f70656e253230536f75726365253230496e6974696174697665266c6162656c3d4c6963656e7365266c6f676f436f6c6f723d776869746526636f6c6f723d626c756576696f6c6574)](https://camo.githubusercontent.com/6b4b23271029d5ecc88ffe9465466586616e533fecffe3a3a8672c14c7f92779/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f59656d656e692d4f70656e2d536f757263652f6c61726176656c2d77616c6c65743f6c6f676f3d4f70656e253230536f75726365253230496e6974696174697665266c6162656c3d4c6963656e7365266c6f676f436f6c6f723d776869746526636f6c6f723d626c756576696f6c6574)[![StandWithPalestine](https://raw.githubusercontent.com/TheBSD/StandWithPalestine/main/badges/StandWithPalestine.svg)](https://github.com/TheBSD/StandWithPalestine/blob/main/docs/README.md)

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

[](#laravel-wallet)

Laravel wallet is a package with expressive pronounced syntax that provide top-notch development covering deposits, withdrawals, transactions and balances all quite simply.

Requirments
-----------

[](#requirments)

This package is tested with Laravel v8 it my not work on Laravel v7 or v6 or v5

SoftwareVersionphp^7.3 | ^8.0 | ^8.1 | ^8.2Composer^2.3Laravel^8.0 | ^9.0 | ^10.0Installation
------------

[](#installation)

Install the package by using composer:

```
composer require yemenopensource/laravel-wallet
```

Configure Your Needs
--------------------

[](#configure-your-needs)

You can scape this step if you want to use default configuration, but you can publish wallet configuration by running:

```
php artisan vendor:publish --provider="YemeniOpenSource\LaravelWallet\WalletServiceProvider" --tag=config
```

This will merge the `config/wallet.php` config file to your root `config` directory. You are free to modify it before migrating the database.

Database Migrations
-------------------

[](#database-migrations)

After that install the wallet tables

```
php artisan migrate
```

If you want to add your customization, publish the migrations:

```
php artisan vendor:publish --provider="YemeniOpenSource\LaravelWallet\WalletServiceProvider" --tag=migrations
```

Laravel will use the publish migrations at `database/migrations`.

Setup
-----

[](#setup)

Add the `HasWallet` trait to any model which you want to add the wallet functionality of it, for example `User` model.

```
use YemeniOpenSource\LaravelWallet\Traits\HasWallet;

class User extends Model
{
    use HasWallet;

    //...
}
```

Basic Usage
-----------

[](#basic-usage)

You can create wallet and transactions for your `User` model as an example mentioned above.

```
// The wallet balance initially will be [0]
$user = User::first();
$user->wallet->balance; // 0

// This will add to the wallet balance as passed amount.
$user->wallet->deposit(643.646);
$user->wallet->balance; // 643.6460

// This will subtract from the wallet balance as passed amount.
$user->wallet->withdraw(168.545);
$user->wallet->balance; // 475.1010

// It will throw [UnacceptedTransactionException] exception if passed amount greater wallet balance
$user->wallet->withdraw(500);
$user->wallet->balance; // UnacceptedTransactionException

// If you want to force withdraw, use [forceWithdraw]
$user->wallet->forceWithdraw(500);
$user->wallet->balance; // -24.8990
```

> If you don't want \[UnacceptedTransactionException\] you can change the `wallet.disable_insufficient_exception` config value to disable the exception or set `WALLET_DISABLE_INSUFFICIENT_EXCEPTION` to `true` on your `.env`

Advanced Usage
--------------

[](#advanced-usage)

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

```
$user = User::first();
$user->wallet->deposit(100, ['currency' => 'USD', 'bank' => 'TEST BANK']);
$user->wallet->withdraw(64, ['currency' => 'USD', 'description' => 'Purchase of Item #101']);
$user->wallet->withdraw(64, ['currency' => 'USD', 'transfer' => 'Western union tracking number #101']);
```

Credits
-------

[](#credits)

[Digital money vector created by fullvector - www.freepik.com](https://www.freepik.com/vectors/digital-money)

Credits
-------

[](#credits-1)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.9% 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 ~92 days

Recently: every ~138 days

Total

7

Last Release

873d ago

Major Versions

v0.4.0 → v1.0.02022-06-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/66c9b114af377fd2400eb4737a18d5d6833a0ece6fc4f9d3b063000d50253f97?d=identicon)[muath-ye](/maintainers/muath-ye)

---

Top Contributors

[![muath-ye](https://avatars.githubusercontent.com/u/34031333?v=4)](https://github.com/muath-ye "muath-ye (86 commits)")[![WatheqAlshowaiter](https://avatars.githubusercontent.com/u/24838274?v=4)](https://github.com/WatheqAlshowaiter "WatheqAlshowaiter (1 commits)")

---

Tags

currencyeloquentlaravelcurrencypaymentwalletvirtualcreditslaravel-walletyemenopensourcemuath-yeyos

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[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)[bavix/laravel-wallet-swap

Addition to the package laravel-wallet.

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

PHPackages © 2026

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