boraguler/round-robin
Composer 安装命令:
composer require boraguler/round-robin
包简介
RoundRobin for Laravel 5.8+ and above...
README 文档
README
BoraGuler\Round-Robin is an easy way to create schedule with round-robin(rr) technique.
Installation
- In order to install BoraGuler\Round-Robin, just add the following to your composer.json. Then run
composer update:
"boraguler/round-robin": "1.0.*"
or run composer require boraguler/round-robin
- Open your
config/app.phpand add the following to theprovidersarray:
BoraGuler\RoundRobin\RoundRobinServiceProvider::class,
- Open your
config/app.phpand add the following to thefacadesarray:
'RoundRobin' => boraguler\RoundRobin\RoundRobinFacade::class,
Controllers and etc
use BoraGuler\RoundRobin\RoundRobin;
Using (Examples)
Setuping (without Facade):
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = new RoundRobin($teams)->make(); // or with 'from' static method $schedule = RoundRobin::from($teams)->make();
With a facade:
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = RoundRobin::from($teams)->make();
Generate a schedule without randomly shuffling the teams using the $shuffle boolean parameter:
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = RoundRobin::from($teams)->doNotShuffle()->make();
Use your own seed with the $seed integer parameter for predetermined shuffling:
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = RoundRobin::from($teams)->shuffle(15)->make();
If you want to pre-define round number (default = 1):
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = RoundRobin::from($teams)->rounds(3)->make();
If you want a double Round-robin:
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = RoundRobin::from($teams)->doubleRoundRobin()->make();
If you want a get a Schedule Object:
$teams = ['Galatasaray', 'Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid']; $schedule = RoundRobin::from($teams)->makeSchedule();
License
BoraGuler Round-Robin is free software distributed under the terms of the MIT license.
统计信息
- 总下载量: 36
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-02