1. Go to this page and download the library: Download stephenjude/laravel-wallet library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stephenjude / laravel-wallet example snippets
use Stephenjude\Wallet\Interfaces\Wallet;
use Stephenjude\Wallet\Traits\HasWallet;
class User extends Authenticatable implements Wallet
{
use HasWallet;
}
$user = User::first();
$user->deposit(200.22); // returns the wallet balance: 200.22
$user->deposit(200); // returns the wallet balance: 400.22
$user->withdraw(200); // returns the wallet balance: 200.22
$user->withdraw(0.22); // returns the wallet balance: 200