Illuminate\Bus\Dispatcher for commands, Illuminate\Queue for async events). The Symfony plugin further bridges compatibility.GreetingCommand → greeting() method) reduces boilerplate. Laravel’s autowiring and facades can abstract the CommandBus/EventMessageBus into a clean API.AggregateRoot::apply() method enables event replay, useful for time-travel debugging or projection rebuilding. However, this requires persistent event storage (e.g., database, Redis), which must be implemented separately.jms/serializer if used).EventExecutionFailed events)DB::transaction)stack logging)EventMessageBus, replaying events)Artisan::command() or Bus facade with LiteCQRS\CommandBus. Use Laravel’s service container to register handlers.Event class or use plain PHP classes. Publish via EventMessageBus instead of event(new MyEvent).queue:work for async event processing. Custom EventQueue implementations can integrate with Illuminate\Queue.LiteCQRSBundle for automatic handler discovery (similar to Laravel’s bind() or tags).events) with columns: id, type, payload, occurred_at. Use Laravel’s migrations and Eloquent models to manage this.aggregate_events table).EventExecutionFailed events for error tracking.Order domain) with:
CreateOrderCommand, CancelOrderCommand).OrderCreatedEvent, OrderCancelledEvent).CommandBus and EventMessageBus for testing.Bus/Events.User, Payment).Event system entirely with LiteCQRS for consistency.| Laravel Feature | LiteCQRS Integration | Notes |
|---|---|---|
| Service Container | Register handlers via bind() or Symfony tags. |
Use LiteCQRSBundle for autowiring. |
| Queues | Custom EventQueue to dispatch to Illuminate\Queue. |
Example: new RedisEventQueue(app('queue.connection')). |
| Events | Replace event(new MyEvent) with EventMessageBus::publish(). |
Events must implement LiteCQRS\DomainEvent (or use naming conventions). |
| Jobs | Commands can be queued via Bus::dispatch() (if extending Laravel’s Bus). |
Requires custom CommandBus wrapper. |
| Eloquent | Store events in DB tables; use apply() for event sourcing. |
Example: OrderAggregate::apply(OrderCreatedEvent $event). |
| Artisan Commands | Use Artisan::call() to trigger commands via CLI. |
Example: php artisan order:create --user=1. |
| Testing | Mock CommandBus/EventMessageBus in PHPUnit. |
Use Mockery to stub event publishing. |
Order, User) and their invariants.CheckoutOrderCommand).CommandBus and EventMessageBus with Laravel services.EventQueue to store events in DB/Redis.apply() methods to aggregates for event sourcing.OrderView table) updated by event listeners.How can I help you explore Laravel packages today?