Download the PHP package towoju5/laravel-wallet without Composer

On this page you can find all versions of the php package towoju5/laravel-wallet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-wallet

Laravel Multi-Wallet Package

Package Name: towoju5/laravel-wallet
Description: A multi-wallet package for Laravel applications, with support for user roles, currency-based wallets, and transaction logging.

Table of Contents

Features

Features

Installation

Step 1: Install the Package via Composer

Step 2: Publish Configuration and Migrations

After installation, publish the configuration file and migrations:

Step 3: Run Migrations

Run the migrations to create the wallets and _transaction tables.

Configuration

The default currency for wallets can be set in the configuration file:

Usage

Creating and Accessing Wallets

Each user can have multiple wallets based on currency or other criteria. Use the getWallet() method to create or retrieve a wallet for the user:

Depositing Funds

Add funds to the wallet with the deposit() method. Optionally, you can include metadata or descriptions for the transaction:

Withdrawing Funds

Withdraw funds from the wallet with the withdraw() method, similarly passing metadata as needed:

Viewing Balance

Retrieve the wallet’s balance, automatically converted from stored format:

Transaction Logs

Each transaction is logged in the _transaction table with the following attributes:

Example Usage in Code

Database Structure

  1. wallets: Stores wallet information for each user and role combination.

    • user_id: User who owns the wallet.
    • role: User role associated with the wallet (e.g., 'admin', 'general').
    • currency: Wallet currency (e.g., 'usd', 'eur').
    • balance: Stored in integer format (cents) for precision.
  2. _transaction: Logs all wallet transactions with relevant details.
    • type: Transaction type (deposit or withdrawal).
    • balance_before: Balance before transaction.
    • balance_after: Balance after transaction.
    • meta: Additional data (JSON format).
    • _account_type: Active user role when the transaction occurred.

Add screenshots of the following to demonstrate:

  1. Database tables (wallets and _transaction) with example data.
  2. Example code execution and output showing wallet creation, deposits, and withdrawals.

This setup should help you create a seamless, multi-currency, role-based wallet system in your Laravel application. Let me know if you'd like more specific guidance on adding the screenshots or other package improvements!


All versions of laravel-wallet with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package towoju5/laravel-wallet contains the following files

Loading the files please wait ....