1. Go to this page and download the library: Download eidolex/e-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/ */
eidolex / e-wallet example snippets
use Eidolex\EWallet\Concerns\HasWallet;
use Eidolex\EWallet\Contracts\HasWalletContract;
class User extends Model implements HasWalletContract
{
/** @use HasWallet<\Eidolex\EWallet\Enums\TransactionName, \Eidolex\EWallet\Models\Wallet, \Eidolex\EWallet\Models\Transaction, \Eidolex\EWallet\Models\Transfer> */
use HasWallet;
}
// Wallet (auto-created on first operation)
$wallet = $user->wallet;
$wallet->balance; // current balance
// All transactions through the wallet
$transactions = $user->transactions;
// app/Models/User.php
use Eidolex\EWallet\Concerns\HasWallet;
use Eidolex\EWallet\Contracts\HasWalletContract;
class User extends Model implements HasWalletContract
{
/** @use HasWallet<\Eidolex\EWallet\Enums\TransactionName, \App\Models\EWallet, \Eidolex\EWallet\Models\Transaction, \Eidolex\EWallet\Models\Transfer> */
use HasWallet;
}
/** @use HasWallet<\Eidolex\EWallet\Enums\TransactionName, \App\Models\EWallet> */
use HasWallet;
bash
php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.