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

2.0.4(7mo ago)26411.7k↓33.3%23[1 PRs](https://github.com/stephenjude/laravel-wallet/pulls)MITPHPPHP ^8.0|^8.1|^8.2CI passing

Since May 11Pushed 4mo 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 1mo ago

READMEChangelog (10)Dependencies (6)Versions (16)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

54

—

FairBetter than 97% of packages

Maintenance71

Regular maintenance activity

Popularity43

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 54.1% 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 ~96 days

Recently: every ~113 days

Total

14

Last Release

218d ago

Major Versions

0.0.7 → 1.0.02023-04-24

1.0.1 → 2.0.02024-07-15

PHP version history (3 changes)0.0.1PHP ^8.0

0.0.3PHP ^8.0|^8.1

2.0.0PHP ^8.0|^8.1|^8.2

### 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 (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (21 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (13 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-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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