Download the PHP package furic/redeem-codes without Composer
On this page you can find all versions of the php package furic/redeem-codes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download furic/redeem-codes
More information about furic/redeem-codes
Files in furic/redeem-codes
Package redeem-codes
Short Description The redeem code system used for creating redeem codes to compensate users, or giving rewards in events.
License MIT
Homepage https://github.com/furic/laravel-redeem-codes
Informations about the package redeem-codes
laravel-redeem-codes
Redeem code generator and redeemer for Laravel 5.*. I developed this package while working for a redeem code solution in Sweaty Chair Studio catering for compensations and event rewards for players. This contains API for redeem code validation and a simple web console to create and edit the redeem codes. This package is aimed to be a plug-n-play solution, I would also recommend Laravel Promocodes and Laravel Vouchers that gives you more freedom and being able to build from scratch.
Table of Contents
- Installation
- Configuration
- Usage
- Web Console
- Redeem Code Parameters
- Redeem Validator API
- Unity Client Repo
- TODO
- License
Installation
Install this package via Composer:
If you are using Laravel 5.5 or later, then installation is done. Otherwise follow the next steps.
Open config/app.php
and follow steps below:
Find the providers
array and add our service provider.
Configuration
Publish config & migration file using Artisan command:
To create table for redeem codes in database run:
Usage
Web Console
After installation, you can simply browse to <server url>
/redeem-codes to open the web console:
Here you can browse, create and edit the redeem codes.
Redeem Code Parameters
- Code Prefix: Set the prefix of the redeem code(s), used for being easier to distingush or with event name. Note that all redeem codes has fixed 12 characters length.
- Reusable: Set if the redeem code(s) is reusable for different players. Note that the server doesn't check if the same user redeeming multiple times, you should add a check to prevent this in your client app.
- Count: Number of redeem code(s) to create.
- Description: The description of the redeem code(s).
- Rewards: The reward type and count, you can add multiple rewards here. The reward type simply is a tiny int and should be convert to Enum in your client app. To add change/add reward type, simply edit the index.blade.php file.
Redeem Validator API
GET <server url>/api/redeem/{code}
Posts the redeem code (12 characters length) and returns the redeem code data. For valid redeem codes, 200 status code is returned with the redeem code JSON data. Otherwise, 400 is returned with the error.
API Document can be found here.
Unity Client Repo
You can simply import this repo in Unity to communicate with your Laravel server with this package.
TODO
- Add item types configurable in config file.
- Add admin login for web console.
- Add tests and factories.
- Add redeem history page (already in database).
- Add reusable server check (low priority).
License
laravel-redeem-codes is licensed under a MIT License.