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

ActiveLibrary[Payment Processing](/categories/payments)

muath-ye/wallet
===============

Easy to use virtual wallet for your laravel app

v9.0.0(3y ago)528[1 issues](https://github.com/muath-ye/wallet/issues)MITPHPPHP &gt;=7.3

Since Oct 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/muath-ye/wallet)[ Packagist](https://packagist.org/packages/muath-ye/wallet)[ Docs](https://github.com/muath-ye/wallet)[ RSS](/packages/muath-ye-wallet/feed)WikiDiscussions father Synced 2d ago

READMEChangelog (10)DependenciesVersions (12)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 one or multiple digital wallets that handle that for you. All the wallet activities are tracked with transactions.

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

[](#installation)

Install the package with composer:

```
composer require muath-ye/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="Muathye\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="Muathye\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 Muathye\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_V2IEyiB3HzGNh17bf4hsQ0fO', 'description' => 'Deposit of 100 credits from Stripe Payment']);
$user->wallet->withdraw(10, ['description' => 'Purchase of Item #12']);
```

Testing
-------

[](#testing)

This package makes use of [orchestral/testbench](https://github.com/orchestral/testbench) 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`

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Recently: every ~54 days

Total

10

Last Release

1348d ago

Major Versions

v2.0.0 → v3.0.02021-10-13

v3.0.0 → v7.1.02021-10-13

v7.8.0 → v9.0.02022-09-03

PHP version history (3 changes)v2.0.0PHP ^7.3|^8.0

v3.0.0PHP ^7.2.5|^8.0

v7.7.0PHP &gt;=7.3

### 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 (9 commits)")

---

Tags

currencypaymentwalletvirtualcreditslaravel-walletmuath-ye

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/muath-ye-wallet/health.svg)](https://phpackages.com/packages/muath-ye-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)[bavix/laravel-wallet-swap

Addition to the package laravel-wallet.

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

Easy to use virtual wallet for your app

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