PHPackages                             ashrafi/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. ashrafi/laravel-wallet

ActiveLibrary

ashrafi/laravel-wallet
======================

Laravel wallet manager.

v0.1(4y ago)191MITPHPPHP &gt;=7.1

Since Jun 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ashrafimanesh/laravel-wallet-manager)[ Packagist](https://packagist.org/packages/ashrafi/laravel-wallet)[ RSS](/packages/ashrafi-laravel-wallet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel Wallet Management Package
=================================

[](#laravel-wallet-management-package)

Wallet Manager can manage user finance with multi accounts and wallets feature.

User can have multi accounts for any purpose of your application. For trading applications you can create a demo account, real account and etc. Each account can has multi wallets to handle your currencies.

### Requirements

[](#requirements)

php: &gt;=7.1

"laravel/framework": "^5.0|^6.0|^7.0|^8.0"

### Installation

[](#installation)

```
composer require ashrafi/laravel-wallet:^v0.1
```

if you want to publish config you can run:

```
php artisan vendor:publish --tag=wallet-manager-config
```

publish seeders

```
php artisan vendor:publish --tag=wallet-manager-seeder
```

Add seeders to `DatabaseSeeder.php`

```
(new CurrencySeeder())->run();
(new TransactionTypeSeeder())->run();
```

*NOTICE:*We use `\App\User` or `\App\Models\User` class to relate tables to the user and you can bind it to other class that implement iUser::class and bind it on `AppServiceProvider`

Next you need to run migrate and db:seed to create database tables and seeds:

```
php artisan migrate
php artisan db:seed
```

*NOTICE:*This package will autoload with laravel and you don't need to add `\Ashrafi\WalletManager\ServiceProvider::class` to your bootstrap.

### Structure

[](#structure)

- Facades: This package use facade pattern for models and you can extend and customize themes. To extend models you need add below codes to your `AppServiceProvider`:

    ```
    use Ashrafi\WalletManager\Models\Wallet;

    //YOUR CODES

    public function register(){
        //YOUR CODES
        //Bind other User class if you don't use \App\User class for authentication
        $this->app->bind(iUser::class, function(){
            return new {YourExtendedClass};
        });

        $this->app->extend(Wallet::class, function(){
            return new {YourExtendedClass};
        });

    }
    ```
- Commands: List of commands are located in src/Commands and you need to use this commands to work with this package features!

**IMPORTANT**Don't use WalletManager models directly and just use their facades: `WalletModel, AccountModel, CurrencyModel,...`
-------------------------------------------------------------------------------------------------------------------------------

[](#importantdont-use-walletmanager-models-directly-and-just-use-their-facades-walletmodel-accountmodel-currencymodel)

- Events:

    The package have WalletEvent and AccountEvent to do anything you need to handle.

    - `WalletCreating`: triggered before create the wallet and after validate input.
    - `WalletCreated`: triggered after create the wallet.
    - `AccountCreating`: triggered before create the account and after validate input.
    - `AccountCreated`: triggered after create the account.

#### Usages

[](#usages)

List of samples are located in samples folder, but you can follow them with this sort: 'transfer', etc).

- Create Account This command will create an account with multi wallets for given user\_id. Exp: You cann create a account for financial or scoring purpose!
- Change wallet balance This command will charge/withdrawal a wallet. You can create `TransactionAmount` object which keep +/-amount, type and status.
- Approve transaction This command will approve transaction and recalculate wallet(s) balance(s).

##### Value objects

[](#value-objects)

- TransactionAmount AttributeTypeDefaultDescriptionamountdouble0posetive amount for charge wallet and negative amount for withdrawtypestringcashDescribe type of the transaction. This value should be find in transaction\_types table.statusstringpending(`pending` or `approved`) If status is on `pending` value, you need to approve the transaction to unlock freeze amount and change wallet balance. If status is on `approved` value, you don't need to approve it in panel and this transaction will create with approved status and wallet balance will change automatically.

##### Adding new transaction type

[](#adding-new-transaction-type)

Each transaction can has seperate table for store related transaction data and validate related data, if so:

1. Add your new type to transaction\_types table.
2. create new `model/class` for it and implement `iRelatedTransactionTypeValidate` class to validate transaction data and implement `iRelatedTransactionTypeCreateRecord` to insert transaction data to your table.
3. add new type to `wallet_manager.transaction_types.types` config file.

**Important transaction types**

1. `init`: This type already is defined and used on create new wallet with init balance.
2. `transfer`: This type already is defined and used on transfer a amount from a wallet to an other wallet.
3. `cash`: This type already is defined and used on charge or withdraw a cash amount without any extra data. We suggest to you define a new type to handle charge/withdraw transaction to store related data

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1795d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16174024?v=4)[ramin ashrafimanesh](/maintainers/ashrafimanesh)[@ashrafimanesh](https://github.com/ashrafimanesh)

---

Top Contributors

[![ashrafimanesh](https://avatars.githubusercontent.com/u/16174024?v=4)](https://github.com/ashrafimanesh "ashrafimanesh (10 commits)")

---

Tags

laravelui

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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