mahbodhastam / laravel-user-wallet
This package is abandoned and no longer maintained.
No replacement package was suggested.
This package allows you to create wallet for the users
Package info
github.com/MahbodHastam/laravel-user-wallet
pkg:composer/mahbodhastam/laravel-user-wallet
Fund package maintenance!
v1.1.1
2021-08-16 14:42 UTC
Requires
- php: ^8.0
- illuminate/collections: ^8.0
- illuminate/contracts: ^8.0
- illuminate/database: ^8.0
- illuminate/support: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- orchestra/testbench: ^6.19
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.8
README
With this package you can create wallet for the users.
Note: Make sure you've already installed php ^8
Installation
Install the package via composer:
composer require mahbodhastam/laravel-user-wallet
Usage
use MahbodHastam\UserWallet\UserWallet; $wallet = UserWallet::createNewWallet(user_id: 1); $amount = $wallet->amount; $token = $wallet->token;
$wallet = UserWallet::getWallet('abc');
$balance = UserWallet::balance($wallet)['total'];
UserWallet::fill($wallet, 100);
UserWallet::charge($wallet, 500);
UserWallet::send( sender: $wallet1, receiver: $wallet2, value: 50 );
$transaction = UserWallet::makeRequest( value: 300, receiver: $wallet ); // Keep it $hash = $transaction->transaction_hash; UserWallet::closeRequest( sender: $wallet, transaction_hash: $hash );
@userWalletBalance($wallet) {{-- $wallet can be wallet's `id`, `token` or an instance from UserWalletModel --}}
See the Tests for more examples.
Testing
composer test
Todos
- Blade Directives
Changelog
See CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.