PHPackages                             heroyt/tournament-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heroyt/tournament-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

heroyt/tournament-generator
===========================

A set of classes used to create multiple kinds of tournament brackets in PHP.

v0.5.5(2y ago)6615.2k—4.2%15[6 issues](https://github.com/Heroyt/tournament-generator/issues)MITPHPPHP &gt;=8.0CI passing

Since Jul 21Pushed 9mo ago5 watchersCompare

[ Source](https://github.com/Heroyt/tournament-generator)[ Packagist](https://packagist.org/packages/heroyt/tournament-generator)[ Docs](https://github.com/Heroyt/tournament-generator)[ RSS](/packages/heroyt-tournament-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

Tournament Generator

=======================

[](#tournament-generator)

#### A set of multiple classes to generate and work with all different kinds of tournament brackets or defining a custom bracket.

[](#a-set-of-multiple-classes-to-generate-and-work-with-all-different-kinds-of-tournament-brackets-or-defining-a-custom-bracket)

[![Latest Stable Version](https://camo.githubusercontent.com/7e307222a259e33b59b82bd4606436363ab0331c5d614f6effb80d0f1e4a14eb/68747470733a2f2f706f7365722e707567782e6f72672f6865726f79742f746f75726e616d656e742d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/heroyt/tournament-generator)[![Total Downloads](https://camo.githubusercontent.com/3dfe96bfe561aec95dcdc14e1cd0b4623c1f2d231f5aa2571d593d32bfa4bb74/68747470733a2f2f706f7365722e707567782e6f72672f6865726f79742f746f75726e616d656e742d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/heroyt/tournament-generator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c1d7174d377fa5b68bc3ed5ae544ef39a95f8de012d6d3ce4f5d0f0b255cff75/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6865726f79742f746f75726e616d656e742d67656e657261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/heroyt/tournament-generator/?branch=master)[![Scrutinizer Build](https://camo.githubusercontent.com/d5d47c95506b91241f3776a7eca9fe7d04715439ba25462d20dbb8cb03ca556a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4865726f79742f746f75726e616d656e742d67656e657261746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Heroyt/tournament-generator/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/9df649f0308794b43a2b387198e82fdb91885464f4529a407bdf06d9a14f24b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4865726f79742f746f75726e616d656e742d67656e657261746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://camo.githubusercontent.com/9df649f0308794b43a2b387198e82fdb91885464f4529a407bdf06d9a14f24b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4865726f79742f746f75726e616d656e742d67656e657261746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)[ ![Documentation Status](https://camo.githubusercontent.com/f07c613e79fdb17e2c895167924d5e6961dd928f7cb6f43b98fbb1d8b8d0f76a/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f746f75726e616d656e742d67656e657261746f722f62616467652f3f76657273696f6e3d6c6174657374)](https://tournament-generator.readthedocs.io/en/latest/?badge=latest)[![Mutation testing badge](https://camo.githubusercontent.com/581a86e5ed795ec865342c2fca685975e19752eaa64af5b6d3b73bca4de0da48/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532464865726f7974253246746f75726e616d656e742d67656e657261746f722532466d6173746572)](https://camo.githubusercontent.com/581a86e5ed795ec865342c2fca685975e19752eaa64af5b6d3b73bca4de0da48/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532464865726f7974253246746f75726e616d656e742d67656e657261746f722532466d6173746572)

[Documentation](https://tournament-generator.readthedocs.io/en/latest/)

[API documentation](https://heroyt.github.io/tournament-generator/)

Features
--------

[](#features)

- Creating a custom tournament bracket with any number of categories, rounds, groups and teams
- Defining a multiple different conditions
- Easily generating Robin-Robin tournaments
- Generating a tournament using a predefined preset (single elimination, double elimination, 2R2G) with any number of teams
- Generating brackets with 2 to 4 teams in one game against each other
- Filling your bracket with results and getting teams table with scores

Installation
------------

[](#installation)

```
$ composer require heroyt/tournament-generator
```

Basic Usage
-----------

[](#basic-usage)

```
require 'vendor/autoload.php';

// Create a tournament
$tournament = new TournamentGenerator\Tournament('Tournament name');

// Set tournament lengths - could be omitted
$tournament
	->setPlay(7) // SET GAME TIME TO 7 MINUTES
	->setGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES
	->setRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES

// Create a round and a final round
$round = $tournament->round("First's round's name");
$final = $tournament->round("Final's round's name");

// Create 2 groups for the first round
$group_1 = $round->group('Round 1')
	->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
	->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP
$group_2 = $round->group('Round 2')
	->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
	->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP

// Create a final group
$final_group = $final->group('Finale')
	->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
	->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP

// CREATE 6 TEAMS
for ($i=1; $i team('Team '.$i);
}

// SET PROGRESSIONS FROM GROUP 1 AND 2 TO FINAL GROUP
$group_1->progression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS
$group_2->progression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS

// Generate games in the first round
$round->genGames();
// Simulate results (or you can fill it with your own real results)
$round->simulate();
// Progress best teams from first round to final round
$round->progress();
// Generate games in the final round
$final->genGames();
// Simulate results (or you can fill it with your own real results)
$final->simulate();

// GET ALL TEAMS
$teams = $tournament->getTeams(true); // TRUE to get teams ordered by their results
```

### Creating a tournament with a template

[](#creating-a-tournament-with-a-template)

```
require 'vendor/autoload.php';

// Create a tournament
$tournament = new TournamentGenerator\Preset\SingleElimination('Tournament name');

// Set tournament lengths - could be omitted
$tournament
	->setPlay(7) // SET GAME TIME TO 7 MINUTES
	->setGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES
	->setRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES

// CREATE 6 TEAMS
for ($i=1; $i team('Team '.$i);
}

// GENERATE ALL GAMES
$tournament->generate();

// Simulate games
$tournament->genGamesSimulate(); // Simulate only games for example to only save bracket to DB
$tournament->genGamesSimulateReal(); // Simulate games with results like a real tournament

// GET ALL TEAMS
$teams = $tournament->getTeams(true); // TRUE to get teams ordered by their results
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~199 days

Total

12

Last Release

298d ago

PHP version history (5 changes)0.0.1PHP &gt;=5.6

v0.3PHP &gt;=7.1

v0.4PHP &gt;=7.4

v0.5.2PHP &gt;=8.0

v0.6.0-alphaPHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e776a17a014bd82ea634c9d3bcfd0c3e87a7ca390b3514ca4d4cb29f52ed8ba?d=identicon)[Heroyt](/maintainers/Heroyt)

---

Top Contributors

[![Heroyt](https://avatars.githubusercontent.com/u/11364097?v=4)](https://github.com/Heroyt "Heroyt (154 commits)")

---

Tags

bracketcustom-bracketgamestournamenttournament-bracketstournament-generatorschedulergeneratorTeamstournamentstournamentbracket

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/heroyt-tournament-generator/health.svg)

```
[![Health](https://phpackages.com/badges/heroyt-tournament-generator/health.svg)](https://phpackages.com/packages/heroyt-tournament-generator)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[symfony/scheduler

Provides scheduling through Symfony Messenger

8810.8M52](/packages/symfony-scheduler)[butschster/cron-expression-generator

Cron expression generator

511.4M2](/packages/butschster-cron-expression-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
