Download the PHP package hesamrad/laravel-wallet without Composer

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

A minimalistic wallet for any Laravel application; it's easy to install and to work with. It also logs every transaction inside storage for future monitoring.

Installation

Install via Composer:

The package will automatically register its service provider.

Configuration

Publish the necessary files:

This will publish the config, migrations and language files used by the wallet.

Usage

There is not much to do after installing. You only have to add a few lines to your desired model to get started; I presume you have a User model that needs a wallet.

  1. Have the User model implement \HesamRad\LaravelWallet\Contracts\HasWallet interface.
  2. Use the \HesamRad\LaravelWallet\Concerns\InteractsWithWallet trait inside the User model.

This will register neccessary methods and functionalities to work with wallet.

And then run the migtations:

And you're done!

How to deposit money into the wallet?

To deposit money into the wallet, call the deposit method on the model:

This will deposit 1.25 into the user's wallet and logs the transaction inside wallet_logs table. (Note that the description and meta fields will be stored inside wallet_logs table.)

How to withdraw money from the wallet?

To withdraw money from the wallet, call the withdraw method on the model:

This will withdraw 1.00 from the user's wallet and logs the transaction inside wallet_logs table. (Note that the description and meta fields will be stored inside wallet_logs table.)

How to get current balance of the wallet?

To get current balance of the wallet, call the balance method on the model:

How to get wallet logs?

To get wallet logs, call logs relationship on the wallet:

Support

If you encounter any issues, have questions or some idea to improve the package, feel free to create an issue or reach out to me:

  1. Create a new issue
  2. Email me

License

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

Credits


All versions of laravel-wallet with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/config Version ^10.0|^11.0|^12.0|^13.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 hesamrad/laravel-wallet contains the following files

Loading the files please wait ...