Downloads
Stars
Version
SierraTecnologia Gamer Various functionality, and basic controller included out-of-the-box.
[x] Point Transaction system for laravel X
Install via composer require sierratecnologia/gamer
And then include the service provider within app/config/app.php
.
'providers' => [
Gamer\GamerProvider::class
];
At last you need to publish and run the migration.
php artisan vendor:publish --provider="Gamer\GamerProvider" && php artisan migrate
<?php
namespace App;
use Gamer\Contracts\Pointable;
use Gamer\Traits\Pointable as PointableTrait;
use Illuminate\Database\Eloquent\Model;
class User extends Model implements Pointable
{
use PointableTrait;
}
$user = User::first();
$amount = 10; // (Double) Can be a negative value
$message = "The reason for this transaction";
//Optional (if you modify the point_transaction table)
$data = [
'ref_id' => 'someReferId',
];
$transaction = $user->addPoints($amount,$message,$data);
dd($transaction);
$user = User::first();
$points = $user->currentPoints();
dd($points);
$user = User::first();
$user->transactions;
//OR
//$user['transactions'] = $user->transactions(2)->get(); //Get last 2 transactions
dd($user);
$user = User::first();
$user['transactions_total'] = $user->countTransactions();
dd($user);
Add pointagram token to your .env
SERVICES_POINTAGRAM_KEY=token_aqui_blalblabla
Refer to the Changelog for a full history of the project.
The following support channels are available at your fingertips:
Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.
Bug reports, feature requests, and pull requests are very welcome.
If you discover a security vulnerability within this project, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.
SierraTecnologia is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Rio de Janeiro, Brazil since June 2008. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.
This software is released under The MIT License (MIT).
(c) 2008-2020 SierraTecnologia, Some rights reserved.