1. Go to this page and download the library: Download wasimrasheed/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/ */
createWallet(array $data): mixed: Creates a new wallet with the provided data.
getWallet(int $id): array: Retrieves the details of a specific wallet by its ID.
getWallets(): Collection: Retrieves a collection of all wallets.
updateWallet(int $id, array $data): string: Updates the wallet details for the specified wallet ID.
deleteWallet(int $id): string: Deletes a wallet identified by its ID.
getWalletByColumn($item, $column): array: Retrieves a wallet based on a specific column value.
createTransaction(array $data): mixed: Creates a new transaction linked to a wallet.
getTransaction(int $id): array: Retrieves the details of a specific transaction by its ID.
getTransactionsByWallet(int $walletId): Collection: Retrieves the transaction history for a specific wallet.
updateTransaction(int $id, array $data): string: Updates the transaction details for the specified transaction ID.
deleteTransaction(int $id): string: Deletes a transaction identified by its ID.
use Wasimrasheed\EWallet\Http\Controllers\TransactionController;
// Create a new transaction
$newTransaction = EWallet::createTransaction([
'wallet_id' => 1,
'amount' => 50.00,
'type' => 'credit',
]);
// Retrieve transaction details
$transactionDetails = EWallet::getTransaction(1);
// Retrieve all transactions for a wallet
$walletTransactions = EWallet::getTransactionsByWallet(1);
// Update transaction
$transactionUpdateMessage = EWallet::updateTransaction(1, ['amount' => 75.00]);
// Delete transaction
$transactionDeleteMessage = EWallet::deleteTransaction(1);
createPaymentMethod(array $data): mixed: Creates a new payment method.
getPaymentMethod(int $id): array: Retrieves the details of a specific payment method by its ID.
getPaymentMethods(): Collection: Retrieves a collection of all payment methods.
updatePaymentMethod(int $id, array $data): string: Updates the payment method details for the specified ID.
deletePaymentMethod(int $id): string: Deletes a payment method identified by its ID.
createActivity(array $data): mixed: Logs a new activity related to wallets.
getActivity(int $id): array: Retrieves the details of a specific activity by its ID.
getActivities(): Collection: Retrieves a collection of all recorded activities.
updateActivity(int $id, array $data): string: Updates the details of a specific activity.
deleteActivity(int $id): string: Deletes an activity identified by its ID.
use Wasimrasheed\EWallet\Http\Controllers\ActivityController;
// Create a new activity
$activityController = new ActivityController();
$newActivity = EWallet::createActivity([
'wallet_id' => 1,
'description' => 'Deposit of $50',
]);
// Retrieve activity details
$activityDetails = EWallet::etActivity(1);
// Retrieve all activities
$allActivities = EWallet::getActivities();
// Update activity
$activityUpdateMessage = EWallet::updateActivity(1, ['description' => 'Updated description']);
// Delete activity
$activityDeleteMessage = EWallet::deleteActivity(1);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.