gift-factory/secret-santa-picker
最新稳定版本:1.1.0
Composer 安装命令:
composer require gift-factory/secret-santa-picker
包简介
Pick a random player for each other player of a given group
README 文档
README
Pick a random player for each other player of a given group
Install
composer require gift-factory/secret-santa-picker
Use
$players = new PlayerList([ new Player('Anna'), new Player('Bob'), // Bob and Dane won't be picked to send a gift to Chuck new Player('Chuck', exclusions: ['Bob', 'Dane']), new Player('Dane'), // Edith and Fiona will be mutually excluded [new Player('Edith'), new Player('Fiona')], ]); $picker = new Picker(); $draw = $picker->pick($players); foreach ($draw as $donor => $receiver) { mail( $donor->email, 'Secret Santa', " Hello $donor->userName, This year, you'll be the santa of $receiver->userName, Here is the address where to send your gift: $receiver->realName $receiver->address ", ); }
Thanks
And a big thank-you to Jet Brains who provides such a great IDE:
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-17