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
A plug-and-play redeem code management system for Laravel applications.
laravel-redeem-codes
is a lightweight package for managing and redeeming codes in Laravel projects. Originally developed for player compensation and event reward systems at Sweaty Chair Studio, this package offers both a clean API and a simple web-based console for managing redeem codes.
If you're looking for more flexible implementations, also consider:
Table of Contents
- Installation
- Configuration
- Usage
- Web Console
- Redeem Code Parameters
- Redeem Validator API
- Unity Client Integration
- TODO
- License
Installation
Install the package via Composer:
Laravel 5.5+ will auto-discover the service provider. For earlier versions, register it manually.
Manual Setup (for Laravel < 5.5)
Add the service provider to your config/app.php
:
Configuration
Publish the package's configuration and migration files:
Then run the migration to create the redeem codes table:
Usage
Web Console
Visit your application at /redeem-codes
to access the web-based admin console.
Use this interface to browse, create, and manage redeem codes visually.
Redeem Code Parameters
When creating a redeem code, the following fields are available:
- Code Prefix: Optional prefix for the redeem code(s), useful for organizing events (e.g.,
EASTER23_
). All codes are 12 characters in total. - Reusable: If enabled, the same code can be used by multiple users. Note: the package does not enforce per-user usage restrictions—you must handle this on the client side.
- Count: Number of codes to generate.
- Description: Internal notes about the purpose of the code batch.
- Rewards: Define one or more reward types with a quantity. Rewards are stored as numeric types and should be interpreted using an Enum or similar mapping on the client side.
To modify reward types or customize the form, edit the
index.blade.php
file.
Redeem Validator API
The API endpoint:
This will return the reward data in JSON format for valid codes (HTTP 200
) or an error response (HTTP 400
) if invalid, already used, or expired.
Explore the API in the Postman documentation.
Unity Client Integration
If you're using Unity, you can connect easily using this open source client: 👉 Unity-Redeem-Codes Repo
TODO
- ✅ Add configurable reward item types via config file.
- 🔒 Add authentication for web console (currently open).
- 🧪 Add tests and model factories.
- 📜 Add history log page (already logged in DB).
- ⚠ Add server-side check for reusable codes (low priority).
License
This package is open-sourced software licensed under the MIT license.