bavix / laravel-wallet

It's easy to work with a virtual wallet
https://bavix.github.io/laravel-wallet/
MIT License
1.15k stars 230 forks source link

Ability to lock the balance #276

Closed martianatwork closed 4 years ago

martianatwork commented 4 years ago

Currently we can achieve this by creating another wallet for locked balance but when we have to deal with multiple currencies its a mess.

We can simply add a locked column after balance and add ability to lock the balance from the balance column, and possibly create a transfer entry to record it.

This will be very useful in some cases and should work fine for people who are not using it.

rez1dent3 commented 4 years ago

Hey. Since version 6.x you have a meta field in your wallet. Any information can be written into it.

https://github.com/bavix/laravel-wallet/blob/c21c97b7907e0c7ce91ac96a03b833cb84c5fb43/database/migrations_v2/2020_10_30_193412_add_meta_wallets_table.php#L28-L30

If you need to add your own field, then I see no problem adding from your side. On the library side, it will not be correct to solve this problem.

You can resort to writing a public extension to the package, here are examples: Extension Description
Swap Addition to the laravel-wallet library for quick setting of exchange rates
Vacuum Addition to the laravel-wallet library for quick fix race condition
rez1dent3 commented 4 years ago

Enough time has passed, I close it.