Download the PHP package joydeep-bhowmik/laravel-point-vault without Composer

On this page you can find all versions of the php package joydeep-bhowmik/laravel-point-vault. 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-point-vault

Laravel Point Vault Documentation

Introduction

Laravel Point Vault provides a flexible points system for your Laravel models. This package allows models to have a "points vault" where you can easily debit and credit points, keep track of balances, and record transactions.

This documentation will guide you through the installation, configuration, and usage of the package.


Requirements


Installation

To install the package, use Composer:

Register the Service Provider

You need to register the package's service provider. If you're using Laravel 5.5 or later, this is automatically handled by the framework’s package auto-discovery feature.

If you are using an earlier version of Laravel or if you’ve disabled auto-discovery, manually add the service provider to the config/app.php file:

Migrations

After registering the service provider, run the package's migrations to create the necessary database table for point transactions.


Configuration

You may want to publish the migration file (if needed) to make modifications before running migrations:


Usage

Applying the HasPoints Trait

To use the points system, add the HasPoints trait to any Eloquent model where you want to manage points. This trait adds functionality for crediting, debiting, and checking balances.

Example:

Methods Provided by the HasPoints Trait

getCurrentBalance()

This method returns the current balance of points for the model.

credit($amount, $note = null)

This method credits a specified amount of points to the model.

debit($amount, $note = null)

This method debits a specified amount of points from the model's balance.

Note: The debit operation checks whether the user has sufficient points before performing the transaction. If there are insufficient points, an exception will be thrown.

points()

This method defines the polymorphic relationship between the model and the Point model. You can use it to access all the point transactions for a model.

Custom Point Transaction Logic

If you want to customize how points are credited or debited, you can extend the provided methods or interact with the Point model directly.


Database Structure

The package expects a points table with the following columns:


Events

You may also hook into Laravel's event system if you wish to listen for point transactions. Although not explicitly included in the provided code, you could easily dispatch events within the makeTransaction method for more complex scenarios.


License

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



All versions of laravel-point-vault with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^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 joydeep-bhowmik/laravel-point-vault contains the following files

Loading the files please wait ....