PHP code example of marcelotk15 / round-robin

1. Go to this page and download the library: Download marcelotk15/round-robin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marcelotk15 / round-robin example snippets


Laravel\RoundRobin\RoundRobinServiceProvider::class,

'RoundRobin' => Laravel\RoundRobin\RoundRobinFacade::class,

use Laravel\RoundRobin\RoundRobin;

$teams = ['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();

$teams = ['Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid'];
$schedule = RoundRobin::from($teams)->make();

$teams = ['Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid'];
$schedule = RoundRobin::from($teams)->doNotShuffle()->make();

$teams = ['Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid'];
$schedule = RoundRobin::from($teams)->shuffle(15)->make();

$teams = ['Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid'];
$schedule = RoundRobin::from($teams)->doubleRoundRobin()->make();

$teams = ['Arsenal', 'Atlético de Madrid', 'Borussia', 'Barcelona','Liverpool', 'Bayer 04', 'Real Madrid'];
$schedule = RoundRobin::from($teams)->makeSchedule();