Scattered Application Logic
How to organize business logic with CQRS in Laravel and Symfony using Ecotone
The Problem You Recognize
What the Industry Calls It
How Ecotone Solves It
class OrderService
{
#[CommandHandler]
public function placeOrder(PlaceOrder $command): void
{
// Only handles placing the order — nothing else
}
#[QueryHandler("order.get")]
public function getOrder(GetOrder $query): OrderView
{
// Only handles reading — no side effects
}
}
class NotificationService
{
#[EventHandler]
public function whenOrderPlaced(OrderWasPlaced $event): void
{
// Reacts to the event — fully decoupled from order logic
}
}Next Steps
Last updated
Was this helpful?