stephenjude/laravel-wallet

A simple wallet implementation for Laravel
11,987 266
Install
composer require stephenjude/laravel-wallet
Latest Version:3.0.1
PHP:^8.0|^8.1|^8.2|^8.3|^8.4
Laravel:9 – 13
Older releases:8
License:MIT
Last Updated:Jun 24, 2026
Links: GitHub  ·  Packagist
Maintainer: stephenjude

Laravel Wallet

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A simple wallet implementation for Laravel.

Learn More

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

Prepare User Model


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

class User extends Authenticatable implements Wallet
{
    use HasWallet;
}

Deposit

$user = User::first();

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

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

Withdraw

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

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

Balance

$user->balance

$user->wallet_balance

Exceptions

InvalidAmountException

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

InsufficientFundException

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

Alternative Package

If you are looking for somthing much bigger and elaborate checkout Bavix Laravel Wallet.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

novatree/wallet

Simple Wallet

2,542 26
stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

367,298 123
stephenjude/laravel-payment-gateways

A simple Laravel API implementation for all payment providers like Paystack, Flu...

5,408 109

Version History

Version Released PHP Laravel License
3.0.1 ^8.0|^8.1|^8.2|^8.3|^8.4 ^9.0|^10.0|^11.0|^12.0|^13.0 MIT
3.0.0 ^8.0|^8.1|^8.2|^8.3|^8.4 ^9.0|^10.0|^11.0|^12.0|^13.0 MIT
2.0.5 ^8.0|^8.1|^8.2 ^9.0|^10.0|^11.0 MIT
2.0.4 ^8.0|^8.1|^8.2 ^9.0|^10.0|^11.0 MIT
2.0.3 ^8.0|^8.1|^8.2 ^9.0|^10.0|^11.0 MIT