PHPackages                             stephenjude/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. stephenjude/laravel-wallet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stephenjude/laravel-wallet
==========================

A simple wallet implementation for Laravel

3.0.1(1w ago)26611.9k↓76.7%23MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4CI passing

Since May 11Pushed 1w ago5 watchersCompare

[ Source](https://github.com/stephenjude/laravel-wallet)[ Packagist](https://packagist.org/packages/stephenjude/laravel-wallet)[ Docs](https://github.com/stephenjude/laravel-wallet)[ GitHub Sponsors](https://github.com/stephenjude)[ RSS](/packages/stephenjude-laravel-wallet/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (24)Versions (21)Used By (0)

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

[](#laravel-wallet)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6b69f4879e6e8dca4fe51e2f1f87daa5873c540eb3e8342fdd16116ec4be7774/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374657068656e6a7564652f6c61726176656c2d77616c6c65742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stephenjude/laravel-wallet)[![GitHub Tests Action Status](https://camo.githubusercontent.com/dcd560c5815b5028b7cd6129e594efd182a06a174ef093ef1dcf8f8e44b2a297/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7374657068656e6a7564652f6c61726176656c2d77616c6c65742f72756e2d74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/stephenjude/laravel-wallet/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d82a423c0e9643ede353a95518ad34bbebd41bbf8652c5e6597ade8ad34030d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7374657068656e6a7564652f6c61726176656c2d77616c6c65742f7068702d63732d66697865722e796d6c3f6c6162656c3d636f64652532307374796c65)](https://github.com/stephenjude/laravel-wallet/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ae7d3afe6758d8519d4d82b098494afa6ebf9b3d581f976f3a5302a582c17db5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7374657068656e6a7564652f6c61726176656c2d77616c6c65742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stephenjude/laravel-wallet)

A simple wallet implementation for Laravel.

Learn More
----------

[](#learn-more)

- [A Simple Wallet Implementation for Laravel - Laravel News](https://laravel-news.com/laravel-wallet)
- [Interfaces and Traits: How to Use Them in Laravel Packages - Laravel Daily](https://www.youtube.com/watch?v=s2vF84rSaEA)
- [Laravel Virtual Wallet with Coupons: 3 Packages Demo - Laravel Daily](https://www.youtube.com/watch?v=Rgu7iEpXRFM&t=44s)

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

[](#installation)

You can install the package via composer:

```
composer require stephenjude/laravel-wallet
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="wallet-migrations"
php artisan migrate
```

Usage
-----

[](#usage)

### Prepare User Model

[](#prepare-user-model)

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

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

### Deposit

[](#deposit)

```
$user = User::first();

$user->deposit(200.22); // returns the wallet balance: 200.22

$user->deposit(200); // returns the wallet balance: 400.22
```

### Withdraw

[](#withdraw)

```
$user->withdraw(200); // returns the wallet balance: 200.22

$user->withdraw(0.22); // returns the wallet balance: 200
```

### Balance

[](#balance)

```
$user->balance

$user->wallet_balance
```

### Exceptions

[](#exceptions)

#### InvalidAmountException

[](#invalidamountexception)

The `InvalidAmountException` is thrown whenever the deposit or withdrawal amount is a negative numeric value or zero.

#### InsufficientFundException

[](#insufficientfundexception)

The `InsufficientFundException` is thrown whenever the withdrawal amount is less than the user's wallet balance.

### Alternative Package

[](#alternative-package)

If you are looking for somthing much bigger and elaborate checkout [Bavix Laravel Wallet](https://bavix.github.io/laravel-wallet/#/).

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [stephenjude](https://github.com/stephenjude)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance98

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

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

Recently: every ~77 days

Total

17

Last Release

10d ago

Major Versions

0.0.7 → 1.0.02023-04-24

1.0.1 → 2.0.02024-07-15

2.0.5 → 3.0.02026-05-31

PHP version history (4 changes)0.0.1PHP ^8.0

0.0.3PHP ^8.0|^8.1

2.0.0PHP ^8.0|^8.1|^8.2

3.0.0PHP ^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

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

---

Top Contributors

[![stephenjude](https://avatars.githubusercontent.com/u/31182887?v=4)](https://github.com/stephenjude "stephenjude (53 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (24 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![eyounelson](https://avatars.githubusercontent.com/u/24621192?v=4)](https://github.com/eyounelson "eyounelson (2 commits)")[![erjanmx](https://avatars.githubusercontent.com/u/4899432?v=4)](https://github.com/erjanmx "erjanmx (1 commits)")[![sweptsquash](https://avatars.githubusercontent.com/u/9886472?v=4)](https://github.com/sweptsquash "sweptsquash (1 commits)")[![xabdulhady](https://avatars.githubusercontent.com/u/89000954?v=4)](https://github.com/xabdulhady "xabdulhady (1 commits)")

---

Tags

laravelwalletlaravelwalletstephenjude

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)

PHPackages © 2026

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