sierratecnologia / gamer
Game
Fund package maintenance!
ricasolucoes
ricasolucoes.com.br/open-source/support-us
Requires
- jordanbrauer/unit-converter: ^0.8.4
- lorisleiva/laravel-actions: ^1.1
- markrogoyski/math-php: *
- php-ai/php-ml: >=0.8
- sierratecnologia/audit: ^0.4.0
- sierratecnologia/muleta: ^0.4.0
- sierratecnologia/pedreiro: ^0.4.0
- spatie/laravel-event-sourcing: ^4.3
Requires (Dev)
- codedungeon/phpunit-result-printer: >=0.27.0
- doctrine/dbal: ^2.10
- fakerphp/faker: ^1.5
- friendsofphp/php-cs-fixer: ^2.16
- illuminate/database: ^6.0|^7.0|^8.0
- mockery/mockery: ^1.0
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpro/grumphp: ^1.3
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.4
- vimeo/psalm: ^4.0
This package is auto-updated.
Last update: 2024-12-23 01:01:42 UTC
README
SierraTecnologia Gamer Various functionality, and basic controller included out-of-the-box.
[x] Point Transaction system for laravel X
Installation
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
Setup a Model
<?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; }
Add Points
$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);
Get Current Points
$user = User::first(); $points = $user->currentPoints(); dd($points);
Get Transactions
$user = User::first(); $user->transactions; //OR //$user['transactions'] = $user->transactions(2)->get(); //Get last 2 transactions dd($user);
Count Transactions
$user = User::first(); $user['transactions_total'] = $user->countTransactions(); dd($user);
Connecting to Pointagram
Add pointagram token to your .env
SERVICES_POINTAGRAM_KEY=token_aqui_blalblabla
Changelog
Refer to the Changelog for a full history of the project.
Support
The following support channels are available at your fingertips:
Contributing & Protocols
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.
Security Vulnerabilities
If you discover a security vulnerability within this project, please send an e-mail to help@sierratecnologia.com.br. All security vulnerabilities will be promptly addressed.
About SierraTecnologia
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.
License
This software is released under The MIT License (MIT).
(c) 2008-2020 SierraTecnologia, Some rights reserved.