A voucher maker works for PHP.

0.1 2019-02-06 16:11 UTC

This package is auto-updated.

Last update: 2024-05-07 04:32:06 UTC


README

A voucher generator that works for PHP.

Features

  • Generate with length specified.
  • Generate with four base string. ex: kmol
  • Generate with eight base string. ex: kqolemdc
  • Generate with prefix and/or suffix
  • Different type of character base.

How to install

composer require yurichandra/maker

How to use

$maker = new Maker(['type' => 'lowercase']);

You can define which type of character that you want to use to generate voucher string.

Types available

  • lowercase ex: qmndbtkq
  • uppercase ex: QMNDBTKQ
  • number ex: 98109182
  • mixed ex: ik12ERkd
//Prefix
$maker = new Maker([
    'type' => 'lowercase'
    'prefix' => 'TKP-'
]);

// Suffix
$maker = new Maker([
    'type' => 'lowercase'
    'prefix' => '-CTP'
]);

You also can define the prefix or suffix in Maker constructor.

//Generate method
$vouchers = $maker->generate($length_of_character, $amount_of_vouchers)

//Generate six base method
$vouchers = $maker->generateSixBase($amount_of_vouchers)

//Generate method
$vouchers = $maker->generateEightBase($amount_of_vouchers)

Thank you.