Download the PHP package abmmhasan/game-draw without Composer
On this page you can find all versions of the php package abmmhasan/game-draw. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abmmhasan/game-draw
More information about abmmhasan/game-draw
Files in abmmhasan/game-draw
Package game-draw
Short Description Generates Item and Item count for winners.
License MIT
Homepage https://abmmhasan.github.io/Lucky-Draw/
Informations about the package game-draw
Game Draw
The Game Draw library provides 2 different way of winner selection based on user's input and selected method.
Please don't use this to generate things/prizes with People's hard-earned money. It is intended to make things fun with bonus gifts only.
Prerequisits
Language: PHP 8/+
PHP Extension: BCMath (may need to install manually)
Installation
Usage (Lucky Draw)
Input Data
-
item: Provide your item's unique identifier
-
chances: Weight of item (Float/Int).
- It will be compared along all the items in array.
- The higher the chances the greater the chances of getting the item.
- In case of active inventory you can pass available item stock here
-
amounts: String or Array of Item amount (Float/Int). It can be any like:
- (array) Single Positive value, i.e. [ 1 ] or Multiple Positive value (randomly picked), i.e. [ 1, 2, 3, 5]
-
(array) Weighted amount, i.e.
- (String) Weighted CSV formatted range (min,max,bias)
- Only 3 members allowed in CSV format min,max,bias
- Max should be greater than or equal to min, bias should be greater than 0
- The higher the bias, the more the chance to pick the lowest amount
Output Data
Will output the data similar as following,
Inventory Solutions
Available stock should be passed (after subtracting used amount from stock amount) in chances properly.
Usage (Grand Draw)
Input Data
-
item: Provide your item's unique identifier
- amounts: Amount of gift. It must be a positive integer value.
To pass users, you've to make a CSV file with at-least 1 column. 1st column will indicate user identity.
Output Data
Will provide the output similar as following,
Support
Having trouble? Create an issue!
All versions of game-draw with dependencies
ext-bcmath Version *