yurichandra / maker
优惠券生成器适用于PHP。
0.1
2019-02-06 16:11 UTC
Requires (Dev)
- phpunit/phpunit: 6.0
This package is auto-updated.
Last update: 2024-09-07 05:13:45 UTC
README
适用于PHP的优惠券生成器。
功能
- 指定长度生成。
- 使用四个基本字符串生成。例如:kmol
- 使用八个基本字符串生成。例如:kqolemdc
- 使用前缀和/或后缀
- 不同类型的字符基础。
如何安装
composer require yurichandra/maker
如何使用
$maker = new Maker(['type' => 'lowercase']);
您可以选择用于生成优惠券字符串的字符类型。
可用的类型
- 小写:例如:qmndbtkq
- 大写:例如:QMNDBTKQ
- 数字:例如:98109182
- 混合:例如:ik12ERkd
//Prefix $maker = new Maker([ 'type' => 'lowercase' 'prefix' => 'TKP-' ]); // Suffix $maker = new Maker([ 'type' => 'lowercase' 'prefix' => '-CTP' ]);
您还可以在Maker构造函数中定义前缀或后缀。
//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)
谢谢。