PHPackages                             phpgears/cqrs-tactician - 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. phpgears/cqrs-tactician

ActiveLibrary

phpgears/cqrs-tactician
=======================

CQRS implementation with League Tactician

0.4.1(6y ago)2179[1 issues](https://github.com/phpgears/cqrs-tactician/issues)MITPHPPHP ^7.1CI failing

Since Sep 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/phpgears/cqrs-tactician)[ Packagist](https://packagist.org/packages/phpgears/cqrs-tactician)[ Docs](https://github.com/phpgears/cqrs-tactician)[ RSS](/packages/phpgears-cqrs-tactician/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (16)Versions (8)Used By (0)

[![PHP version](https://camo.githubusercontent.com/d0b5687c6812c5d52d86a548e09db527eeb7860f82adbb677de00a36ddbed1b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](http://php.net)[![Latest Version](https://camo.githubusercontent.com/4364e73464256287140824d4d5e52c24f30a7a59c8e8abe114e9c91feaf7fdb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/cqrs-tactician)[![License](https://camo.githubusercontent.com/c33b1658bb9e67165e65a88a936b6aa0a8bfe6ed48826acf731d0955effb90aa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpgears/cqrs-tactician/blob/master/LICENSE)

[![Build Status](https://camo.githubusercontent.com/85dfe975a255c85587bd65204b6572cd9714a84eb2ff10ba2025c095ab97f4ec/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/github/phpgears/cqrs-tactician)[![Style Check](https://camo.githubusercontent.com/8caee8f8cece2b071dc114de38b2d542658259e637a8cd559b7a56e520bcdf9d/68747470733a2f2f7374796c6563692e696f2f7265706f732f3135303836383330382f736869656c64)](https://styleci.io/repos/150868308)[![Code Quality](https://camo.githubusercontent.com/2f1685a1f88f00a6674498bec8b833f72e52a1243c03c3b3c97b7b135bd33709/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpgears/cqrs-tactician)[![Code Coverage](https://camo.githubusercontent.com/388e7705aa421f3133dee24860e9a674ae7112ebb8861d2ad6b3850a4df91316/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/phpgears/cqrs-tactician)

[![Total Downloads](https://camo.githubusercontent.com/a361a667f188016c236fc6c2a149a7bc85f1e9620c4256089223ea9a52f01686/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/cqrs-tactician/stats)[![Monthly Downloads](https://camo.githubusercontent.com/17d23d46eaa31a5d91a0dbe51e2d0debd979678bf420026a356d2f1a29776263/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f70687067656172732f637172732d74616374696369616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/cqrs-tactician/stats)

CQRS with Tactician
===================

[](#cqrs-with-tactician)

CQRS implementation with League Tactician

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

[](#installation)

### Composer

[](#composer)

```
composer require phpgears/cqrs-tactician

```

Usage
-----

[](#usage)

Require composer autoload file

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

### Commands Bus

[](#commands-bus)

```
use Gears\CQRS\Tactician\CommandBus;
use Gears\CQRS\Tactician\CommandHandlerMiddleware;
use League\Tactician\CommandBus as TacticianBus;
use League\Tactician\Handler\Locator\InMemoryLocator;
use League\Tactician\Plugins\LockingMiddleware;

$commandToHandlerMap = [];

$tacticianBus = new TacticianBus([
    new LockingMiddleware(),
    new CommandHandlerMiddleware(new InMemoryLocator($commandToHandlerMap)),
]);

$commandBus = new CommandBus($tacticianBus);

/** @var \Gears\CQRS\Command $command */
$commandBus->handle($command);
```

### Query Bus

[](#query-bus)

```
use Gears\CQRS\Tactician\QueryBus;
use Gears\CQRS\Tactician\QueryHandlerMiddleware;
use League\Tactician\CommandBus as TacticianBus;
use League\Tactician\Handler\Locator\InMemoryLocator;
use League\Tactician\Plugins\LockingMiddleware;

$queryToHandlerMap = [];

$tacticianBus = new TacticianBus([
    new LockingMiddleware(),
    new QueryHandlerMiddleware(new InMemoryLocator($queryToHandlerMap)),
]);

$queryBus = new QueryBus($tacticianBus);

/** @var \Gears\CQRS\Query $query */
$result = $queryBus->handle($query);
```

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

[](#contributing)

Found a bug or have a feature request? [Please open a new issue](https://github.com/phpgears/cqrs-tactician/issues). Have a look at existing issues before.

See file [CONTRIBUTING.md](https://github.com/phpgears/cqrs-tactician/blob/master/CONTRIBUTING.md)

License
-------

[](#license)

See file [LICENSE](https://github.com/phpgears/cqrs-tactician/blob/master/LICENSE) included with the source code for a copy of the license terms.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Recently: every ~90 days

Total

6

Last Release

2410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c50421f1ab4148354dc2dd5dcaba168656b17ea913b310d112deb39a6f73ca1?d=identicon)[juliangut](/maintainers/juliangut)

---

Top Contributors

[![juliangut](https://avatars.githubusercontent.com/u/1104131?v=4)](https://github.com/juliangut "juliangut (11 commits)")

---

Tags

querycommandtacticianimmutablecqrs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpgears-cqrs-tactician/health.svg)

```
[![Health](https://phpackages.com/badges/phpgears-cqrs-tactician/health.svg)](https://phpackages.com/packages/phpgears-cqrs-tactician)
```

###  Alternatives

[cherif/yii2-tactician

Yii2 component for Tactician command bus library

201.8k1](/packages/cherif-yii2-tactician)

PHPackages © 2026

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