mechawrench / laracoins
WebApp currency, can be traded/sold/bought by users
v1.2.1
2021-04-30 22:56 UTC
Requires
- php: ^7.1 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- orchestra/testbench: ^5.0
- phpunit/phpunit: ^9.0
- psalm/plugin-laravel: ^1.2
- vimeo/psalm: ^3.11
This package is auto-updated.
Last update: 2024-10-29 06:18:35 UTC
README
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.