PHPackages                             ecotone/ecotone - 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. ecotone/ecotone

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

ecotone/ecotone
===============

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

1.314.0(2w ago)562565.8k↓22.1%249Apache-2.0PHPPHP ^8.2CI failing

Since Jul 31Pushed 3w ago19 watchersCompare

[ Source](https://github.com/ecotoneframework/ecotone)[ Packagist](https://packagist.org/packages/ecotone/ecotone)[ Docs](https://docs.ecotone.tech)[ GitHub Sponsors](https://github.com/dgafka)[ RSS](/packages/ecotone-ecotone/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (45)Versions (697)Used By (9)

This is Read Only Repository
============================

[](#this-is-read-only-repository)

To contribute make use of [Ecotone-Dev repository](https://github.com/ecotoneframework/ecotone-dev).

[ ![](https://github.com/ecotoneframework/ecotone-dev/raw/main/ecotone_small.png?raw=true)](https://ecotone.tech)

[![Github Actions](https://github.com/ecotoneFramework/ecotone-dev/actions/workflows/split-testing.yml/badge.svg)](https://github.com/ecotoneFramework/ecotone-dev/actions/workflows/split-testing.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/6d3fefd097526666ca1a13fdfa023a2d467c0098ea4f7d560fdea28943d80540/68747470733a2f2f706f7365722e707567782e6f72672f65636f746f6e652f65636f746f6e652f762f737461626c65)](https://packagist.org/packages/ecotone/ecotone)[![License](https://camo.githubusercontent.com/0c825aa97178c47064bc47ec45c9d4148075c860403419e45dbabcb9050d510c/68747470733a2f2f706f7365722e707567782e6f72672f65636f746f6e652f65636f746f6e652f6c6963656e7365)](https://packagist.org/packages/ecotone/ecotone)[![Total Downloads](https://camo.githubusercontent.com/2aec5363d172979490a34009950f2a61290dbb48965361bcbfda9aa28504f7e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65636f746f6e652f65636f746f6e65)](https://packagist.org/packages/ecotone/ecotone)[![PHP Version Require](https://camo.githubusercontent.com/b14eabeef1e6ee3612c8d62386855072c5fdad12affbbd987935c1397ebea214/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f65636f746f6e652f65636f746f6e652f7068702e737667)](https://packagist.org/packages/ecotone/ecotone)

Ecotone — the PHP architecture layer that grows with your system, without rewrites
==================================================================================

[](#ecotone--the-php-architecture-layer-that-grows-with-your-system-without-rewrites)

From `#[CommandHandler]` on day one, to event sourcing, sagas, outbox, and distributed messaging at scale — one package, same codebase, no forced migrations between growth stages. Declarative PHP 8 attributes on the classes you already have. No base classes, no bus wiring, no retry config.

Built on Enterprise Integration Patterns — the same pattern language behind Spring Integration, Axon, NServiceBus, and Apache Camel — brought to PHP as attribute-driven code.

Visit [ecotone.tech](https://ecotone.tech) for the full overview.

---

See what it looks like
----------------------

[](#see-what-it-looks-like)

```
class OrderService
{
    #[CommandHandler]
    public function placeOrder(PlaceOrder $command, EventBus $eventBus): void
    {
        // your business logic
        $eventBus->publish(new OrderWasPlaced($command->orderId));
    }

    #[QueryHandler('order.getStatus')]
    public function getStatus(string $orderId): string
    {
        return $this->orders[$orderId]->status;
    }
}

class NotificationService
{
    #[Asynchronous('notifications')]
    #[EventHandler]
    public function whenOrderPlaced(OrderWasPlaced $event, NotificationSender $sender): void
    {
        $sender->sendOrderConfirmation($event->orderId);
    }
}
```

**That's the entire setup.** No bus configuration. No handler registration. No retry config. No serialization wiring. Ecotone reads your attributes and handles the rest:

- **Command, Query, and Event Bus** — wired automatically from your attributes
- **Event routing** — handlers subscribe to events without manual wiring
- **Async execution** — `#[Asynchronous('notifications')]` routes to RabbitMQ, SQS, Kafka, Redis, or DBAL
- **Failure isolation** — each event handler gets its own copy of the message, so one handler's failure never blocks another
- **Retries and dead letter** — failed messages retry automatically; permanently failed ones go to a dead letter queue you can inspect and replay
- **Tracing** — OpenTelemetry traces every message across sync and async flows

---

Test exactly the flow you care about
------------------------------------

[](#test-exactly-the-flow-you-care-about)

Extract a specific flow and test it in isolation — only the services you need:

```
$ecotone = EcotoneLite::bootstrapFlowTesting([OrderService::class]);

$ecotone->sendCommand(new PlaceOrder('order-1'));

$this->assertEquals('placed', $ecotone->sendQueryWithRouting('order.getStatus', 'order-1'));
```

Only `OrderService` is loaded — no notifications, no other handlers. Just the flow you're verifying.

Now bring in the full async flow. Enable an in-memory channel and run it inside the same test process:

```
$notifier = new InMemoryNotificationSender();

$ecotone = EcotoneLite::bootstrapFlowTesting(
    [OrderService::class, NotificationService::class],
    [NotificationSender::class => $notifier],
    enableAsynchronousProcessing: [
        SimpleMessageChannelBuilder::createQueueChannel('notifications')
    ]
);

$ecotone
    ->sendCommand(new PlaceOrder('order-1'))
    ->run('notifications');

$this->assertEquals(['order-1'], $notifier->getSentOrderConfirmations());
```

Swap the in-memory channel for DBAL, RabbitMQ, or Kafka in production — the test stays the same. Ecotone runs the consumer in-process, so switching transports never changes how you test.

---

What's in the box
-----------------

[](#whats-in-the-box)

AreaWhat you get**Messaging**Command / Query / Event buses, routing, interceptors, business interfaces (gateways)**Domain modelling**Aggregates, Sagas, state-stored or event-sourced — all via attributes**Event Sourcing**Event Store, Projections (catch-up, partitioned, streaming), event versioning and upcasting, DCB**Workflows**Stateless workflows, orchestrators (routing slip), saga-based process managers**Async &amp; resiliency**`#[Asynchronous]`, retries, error channels, dead letter queue with replay, Outbox pattern**Observability**OpenTelemetry tracing, Service Map (Enterprise)**Multi-tenancy**Per-tenant connections, event stores, and async channels**Distribution**Distributed Bus for cross-service events and commands**Data protection**Field-level encryption and PII masking for messages---

Install for your framework
--------------------------

[](#install-for-your-framework)

Ecotone is not a replacement for Symfony Messenger or Laravel Queue — it's the architecture layer on top. Your existing HTTP layer, transports, and jobs keep working.

**Symfony**

```
composer require ecotone/symfony-bundle
```

Symfony Messenger compatible. Bundle auto-configuration. Doctrine ORM integration. Pure POPOs. → [Symfony guide](https://docs.ecotone.tech/modules/symfony-ddd-cqrs-event-sourcing)

**Laravel**

```
composer require ecotone/laravel
```

Works with Eloquent and Doctrine. Laravel Queue integration. Auto-discovery, zero config. → [Laravel guide](https://docs.ecotone.tech/modules/laravel-ddd-cqrs-event-sourcing)

**Any PSR-11 framework (Ecotone Lite)**

```
composer require ecotone/ecotone
```

Full feature set. No framework lock-in. → [Ecotone Lite guide](https://docs.ecotone.tech/install-php-service-bus#install-ecotone-lite-no-framework)

---

AI-Ready by design
------------------

[](#ai-ready-by-design)

Declarative attributes mean less infrastructure code for your coding agent to read and less boilerplate for it to generate — smaller context, faster iteration, more accurate results.

- **MCP Server**: `https://docs.ecotone.tech/~gitbook/mcp` — Install in VSCode
- **Agentic Skills** — ready-to-use skills that teach any coding agent to correctly write handlers, aggregates, sagas, projections, and tests
- **LLMs.txt**: [ecotone.tech/llms.txt](https://ecotone.tech/llms.txt)
- **Context7**: Available via [@upstash/context7-mcp](https://github.com/upstash/context7)

Learn more: [AI Integration Guide](https://docs.ecotone.tech/other/ai-integration)

---

Getting started
---------------

[](#getting-started)

See the [quickstart guide](https://docs.ecotone.tech/quick-start), the [full documentation](https://docs.ecotone.tech), and the [Ecotone Blog](https://blog.ecotone.tech).

Prefer runnable code? The [quickstart examples](https://github.com/ecotoneframework/quickstart-examples) cover handlers, aggregates, sagas, event sourcing, projections, outbox, multi-tenancy, and more — each running end-to-end in seconds.

Feature requests and issue reporting
------------------------------------

[](#feature-requests-and-issue-reporting)

Use [issue tracking system](https://github.com/ecotoneframework/ecotone-dev/issues) for new feature request and bugs. Please verify that it's not already reported by someone else.

Contact
-------

[](#contact)

If you want to talk or ask questions about Ecotone

- [**Twitter**](https://twitter.com/EcotonePHP)
- ****
- [**Community Channel**](https://discord.gg/GwM2BSuXeg)

Support Ecotone
---------------

[](#support-ecotone)

If you want to help building and improving Ecotone consider becoming a sponsor:

- [Sponsor Ecotone](https://github.com/sponsors/dgafka)
- [Contribute to Ecotone](https://github.com/ecotoneframework/ecotone-dev).

Tags
----

[](#tags)

PHP, DDD, CQRS, Event Sourcing, Sagas, Projections, Workflows, Outbox, Symfony, Laravel, Service Bus, Event Driven Architecture

###  Health Score

74

—

ExcellentBetter than 100% of packages

Maintenance96

Actively maintained with recent releases

Popularity57

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 89.1% 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 ~3 days

Total

690

Last Release

14d ago

Major Versions

0.12.15 → 1.0.02021-03-04

PHP version history (6 changes)0.1.0PHP &gt;=7.3.0

0.10.22PHP &gt;=7.4

1.0.0PHP &gt;=8.0

1.32.1PHP ^8.0

1.237.0PHP ^8.1

1.283.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b6139b0dc15c550b22c76954ec6a96ac6c46b4c19b4a3c1e93c2146481e109e?d=identicon)[dgafka](/maintainers/dgafka)

---

Top Contributors

[![dgafka](https://avatars.githubusercontent.com/u/6060791?v=4)](https://github.com/dgafka "dgafka (1270 commits)")[![ecotoneframework-bot](https://avatars.githubusercontent.com/u/174240763?v=4)](https://github.com/ecotoneframework-bot "ecotoneframework-bot (149 commits)")[![aidan-casey](https://avatars.githubusercontent.com/u/6686277?v=4)](https://github.com/aidan-casey "aidan-casey (5 commits)")[![lrotermund](https://avatars.githubusercontent.com/u/22943809?v=4)](https://github.com/lrotermund "lrotermund (1 commits)")

---

Tags

cqrsdddecotoneevent-sourcinglaravelphpsymfonyevent-drivenworkflowdddevent sourcingcqrsservice-busmessage-drivenecotoneprojectionssagasoutboxdurable-workflowsdurable-execution

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ecotone-ecotone/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k532.1M19.2k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[patchlevel/event-sourcing

A lightweight but also all-inclusive event sourcing library with a focus on developer experience

202332.6k11](/packages/patchlevel-event-sourcing)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1237.8M117](/packages/web-auth-webauthn-lib)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)

PHPackages © 2026

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