Download the PHP package webafra/laravel-user-wallet without Composer
On this page you can find all versions of the php package webafra/laravel-user-wallet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webafra/laravel-user-wallet
More information about webafra/laravel-user-wallet
Files in webafra/laravel-user-wallet
Package laravel-user-wallet
Short Description laravel user wallet manager
License MIT
Homepage https://github.com/webafra/laravel-user-wallet
Informations about the package laravel-user-wallet
laravel user wallet manager
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
Prepare User Model
To use this package you need to implement the WalletOperations into User model and utilize the ManagesWallet trait.
Prepare Wallets
In Laravel Pay Pocket, you have the flexibility to define the order in which wallets are prioritized for payments through the use of Enums. The order of wallets in the Enum file determines their priority level. The first wallet listed has the highest priority and will be used first for deducting order values.
For example, consider the following wallet types defined in the Enum class (published in step 3 of installation):
You have complete freedom to name your wallets as per your requirements and even add more wallet types to the Enum list.
In this particular setup, wallet_1 (WALLET1) is given the highest priority. When an order payment is processed, the system will first attempt to use wallet_1 to cover the cost. If wallet_1 does not have sufficient funds, wallet_2 (WALLET2) will be used next.
Example:
If the balance in wallet_1 is 10 and the balance in wallet_2 is 20, and you need to pay an order value of 15, the payment process will first utilize the entire balance of wallet_1. Since wallet_1's balance is insufficient to cover the full amount, the remaining 5 will be deducted from wallet_2. After the payment, wallet_2 will have a remaining balance of 15."
Usage, APIs and Operations:
Deposit
Deposit funds into wallet_1
Deposit funds into wallet_2
Or using provided facade
Note: wallet_1 and wallet_2 must already be defined in the WalletEnums.
Transaction Info ([#8][i8])
When you need to add descriptions for a specific transaction, the $notes parameter enables you to provide details explaining the reason behind the transaction.
Pay
Pay the value using the total combined balance available across all allowed wallets
Or using provided facade
Balance
-
Wallets
- Particular Wallet
Exceptions
Upon examining the src/Exceptions directory within the source code,
you will discover a variety of exceptions tailored to address each scenario of invalid entry.
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
- webafra
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-user-wallet with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
