Download the PHP package nishant/wallet without Composer

On this page you can find all versions of the php package nishant/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 wallet

Nishant Wallet - Multi-Wallet Management Package for Laravel 11

Latest Version on Packagist Total Downloads License

A comprehensive Laravel package for managing multiple wallets per user with deposit, withdraw, and transaction tracking capabilities. Built for Laravel 11 and PHP 8.0+.

Features

Requirements

Installation

Step 1: Install the Package

Option A: Install from Packagist (Production)

If the package is published to Packagist, use:

Note: If you get a stability error, make sure the package has a stable version tag (v1.0.0) in the Git repository. You can also install a specific version:

Or if you need to allow dev stability temporarily:

Option B: Local Development Setup

If you're developing the package locally or testing it before publishing, add it to your Laravel project's composer.json:

Important Notes for Local Development:

Project Structure:

After adding the repository configuration, run:

Step 2: Publish Configuration and Migrations

Publish the configuration file:

Publish the migrations:

Step 3: Run Migrations

Run the database migrations:

Step 4: Add Trait to User Model

Add the HasWallets trait to your User model:

Configuration

The configuration file is located at config/wallet.php. You can customize:

Usage

Creating Wallets

Using the Trait (Recommended)

Using the Service

Depositing Amount

Using the Wallet Model

Using the Service

Withdrawing Amount

Using the Wallet Model

Using the Service

Getting Transactions

Get All Transactions for a Wallet

Get Transactions by Wallet Name

Get Transactions by Type

Confirming Pending Transactions

When you create a transaction with confirmed: false, the wallet balance is not affected. You can confirm the transaction later to apply the balance change.

Using the Service

Check Transaction Status

Getting Wallet Information

API Endpoints

The package provides RESTful API endpoints. Make sure you have authentication middleware configured.

Wallet Endpoints

Transaction Endpoints

API Request Examples

Create Wallet

Deposit Amount

Deposit Amount (Pending)

Withdraw Amount

Withdraw Amount (Pending)

Confirm Pending Transaction

Response:

Get Transactions by Wallet Name

Interfaces

The package uses interfaces for better code organization:

WalletInterface

TransactionInterface

Traits

HasWallets Trait

Add this trait to your User model to enable wallet functionality:

This trait provides methods like:

Walletable Trait

This trait is automatically used by the Wallet model and provides:

Database Schema

Wallets Table

Wallet Transactions Table

Note: When confirmed is false, the transaction is created but the wallet balance is not updated. The balance will only be updated when the transaction is confirmed using the confirmTransaction() method.

Error Handling

The package throws exceptions for various scenarios:

Always wrap wallet operations in try-catch blocks:

Testing

To test the package, you can use Laravel's testing features:

License

This package is open-sourced software licensed under the MIT license.

Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

Changelog

Version 1.1.0

Version 1.0.0


All versions of wallet with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^11.0
illuminate/database Version ^11.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 nishant/wallet contains the following files

Loading the files please wait ...