PHPackages                             tackacoder/tournament-services - 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. tackacoder/tournament-services

ActiveLibrary

tackacoder/tournament-services
==============================

Generate different tournaments with teams and schedule.

v1.2.2(2y ago)15MITPHPPHP &gt;=8.1

Since May 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/EdouardTack/tournament-generator)[ Packagist](https://packagist.org/packages/tackacoder/tournament-services)[ Docs](https://github.com/EdouardTack/tournament-generator)[ RSS](/packages/tackacoder-tournament-services/feed)WikiDiscussions production Synced 1mo ago

READMEChangelogDependencies (8)Versions (7)Used By (0)

Tournament generator
====================

[](#tournament-generator)

[![php workflow](https://github.com/EdouardTack/tournament-generator/actions/workflows/php.yml/badge.svg)](https://github.com/EdouardTack/tournament-generator/actions/workflows/php.yml/badge.svg)

Features
--------

[](#features)

- Create a simple round robin tournament with an even count teams and home/away matches

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

[](#installation)

`$ composer require tackacoder/tournament-services`

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

[](#basic-usage)

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

use Carbon\CarbonImmutable;
use Tackacoder\Tournament\Tournament;

/**
 * Create a tournament
 *
 * ` Tournament
 *   - Tournament name
 *   - Tournament Mode
 *   - Tournament generate date
 *
 * ` Teams
 *   - List of teams
 *
 * ` Matches
 *   - Day name
 *
 *   ` Schedules
 *     - Schedule Date
 *
 *     ` Matches
 *       - Home Team
 *       - Away Team
 *       - Score
 *       - Stats
 *
 * TOURNAMENT_MODE is a service variable
 * By default, services are included :
 * - championship
 * - cup
 */
$TOURNAMENT_MODE = 'championship';
$tournament = new Tournament('My tournament title', $TOURNAMENT_MODE);

// OR
$tournament = new Tournament();
$tournament->setName('My tournament title')->setMode($TOURNAMENT_MODE);

// Complete with teams
$tournament->setTeams([
    [
        "name" => "Team One",
        "status" => true
    ],
    [
        "name" => "Team Two",
        "status" => false
    ],
    [
        "name" => "Team Three",
        "status" => true
    ],
    [
        "name" => "Team Four",
        "status" => true
    ]
]);
// Change the start date
$tournament->setDate(date: CarbonImmutable::now('UTC'));

$tournament->addService(new ChampionshipService());
$result = $tournament->generate();
```

### Championship Service Usage

[](#championship-service-usage)

The Championship Service object can be construct with optionals parameters :

- interval : See [documentation](https://carbon.nesbot.com/docs/#api-interval)
- callable : Closure to send event on diffrent endpoint

```
new ChampionshipService('2 days', function ($args) {
    $endpoint = $args['name'];
    event(new Event($args));
});
```

On generate method, yon can add some configuration parameters to send to Services. For `ChampionshipService`, you can add mirror and shift configuration.

```
[...]

$tournament->generate([
    'mirror' => false, // false => each Teams meet once, true => home & away matches
    'shift' => 3 // Shift as many matches to avoid meeting teams on the same model
]);
```

The default configuration parameters to `generate()` are : \* The name of the tournament \* The date of creation \* Teams collection

### Create a generator service

[](#create-a-generator-service)

```
use Tackacoder\Tournament\Services\Service;
use Tackacoder\Tournament\Supports\ServiceInterface;

class MyServiceService extends Service implements ServiceInterface
{
    /**
     * NEEDED to find the generator
     */
    protected string $name = 'my_service';

    public function generate(array $config): array
    {
        $this->setConfig($config);

        $date = $this->getConfig('date');
        $teams = $this->getConfig('teams');
        $name = $this->getConfig('name');

        return [];
    }
}

// In other file
$tournament = new Tournament();
$tournament->setMode('my_service');
```

Contributing
------------

[](#contributing)

### Run Functional Tests

[](#run-functional-tests)

`$ composer test` or `$ php vendor/bin/pest`

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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 ~6 days

Total

6

Last Release

1065d ago

PHP version history (2 changes)v1.0PHP &gt;=8.2

v1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1575dc0cc553c37e26790cefaf03ad615f7625510eeef7a37d926f7ca9890b13?d=identicon)[Tackacoder](/maintainers/Tackacoder)

---

Top Contributors

[![EdouardTack](https://avatars.githubusercontent.com/u/1247641?v=4)](https://github.com/EdouardTack "EdouardTack (23 commits)")

---

Tags

generatorscheduletournamentbracketcontests

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tackacoder-tournament-services/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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