mechawrench/laracoins

WebApp currency, can be traded/sold/bought by users

v1.2.1 2021-04-30 22:56 UTC

This package is auto-updated.

Last update: 2024-04-29 04:53:21 UTC


README

LaraCoins Package

Latest Version on Packagist Tests Total Downloads

WebApp currency, can be traded/sold/bought by users.

Installation

You can install the package via composer:

composer require mechawrench/laracoins

You can publish and run the migrations with:

php artisan vendor:publish --provider="Mechawrench\Laracoins\LaracoinsServiceProvider" --tag="migrations"
php artisan migrate

Usage

// Import class (at top of file)
use Mechawrench\Laracoins;

// Fund user account
Laracoins::fundUser($user_id, $quantity, $comment);

// Lock and unlock user coins
Laracoins::lockUser($user_id);
Laracoins::unlockUser($user_id);

// Send coins between users
Laracoins::tradeCoins($to_user_id, $from_user_id, $amount, $comment);

// Get user balance
Laracoins::balance($user_id);

// Get user history
Laracoins::userHistory($user_id);

// Get top coin holders, sorted in desc order
Laracoins::topHolders();
Laracoins::topHolders($quantity);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email jesse.schneider@hey.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.