- Does lingoda/domain-events work with Laravel and Eloquent?
- Not as a drop-in dependency for a typical Laravel/Eloquent application. The package is shipped as a Symfony bundle with Doctrine lifecycle hooks, so its Laravel integration claim should be read as using a PSR-style dispatcher rather than native Eloquent support. For Laravel/Eloquent, treat it as a reference implementation and use Laravel transaction callbacks, afterCommit semantics, model events, or observers instead. It is only a direct fit for Symfony with Doctrine, or possibly a Laravel plus Doctrine hybrid after proving the hooks against the Laravel container.
- How do I install lingoda/domain-events?
- For a Symfony/Doctrine application, install it with Composer using lingoda/domain-events, register the bundle, and implement the recording contract on your aggregates. For a Laravel application, do not assume a normal Composer require and service provider setup will be enough, because the package is Doctrine-oriented. Verify the enforced PHP, Symfony, Doctrine, and framework support matrix in composer.json and CI before adopting.
- Is lingoda/domain-events transaction-aware and dispatched after commit?
- Yes, the intended pattern is to record domain events inside aggregates and release them once the unit of work completes, after commit. This helps prevent events from rolled-back work being dispatched to listeners. However, it is not a transactional outbox, and events buffered in memory can be lost if the process dies between commit and dispatch.
- Does lingoda/domain-events persist domain events in an outbox table?
- There is no evidence that it persists events in an outbox table. The pattern described buffers events in memory and releases them after the flush or unit of work completes. That makes it a convenience for decoupling domain code from side effects, not a durable reliability mechanism. If you need guaranteed delivery, build or adopt a transactional outbox with idempotent consumers.
- Can I use lingoda/domain-events with queues or async transport?
- The package appears to dispatch events synchronously in-process through an event dispatcher, with no evident Symfony Messenger or queue transport support. Any async path you add will introduce retries, ordering concerns, and duplicate delivery risks. Without built-in idempotency keys, every consumer must deduplicate and handle failures defensively.
- What Laravel and PHP versions does lingoda/domain-events support?
- The support matrix must be verified rather than assumed. The package is Symfony and Doctrine oriented, and there is no compatibility corpus or third-party validation to rely on. Check composer.json, CI configuration, and recent release notes for the enforced PHP, Symfony, Doctrine, and Laravel-compatible versions before planning adoption.
- How do I test domain events recorded in aggregates?
- Use the provided traits and interfaces to record, release, and clear events, then unit test that an aggregate records the expected typed events without injecting Laravel's dispatcher. In integration tests, assert that releasing maps the recorded domain events to the expected Laravel events and listeners after commit. Clear buffered events between tests to prevent state leaking across test cases.
- Is lingoda/domain-events maintained and safe for production?
- It is a single-vendor extraction with 8 stars, zero dependents, and no third-party validation, so the bus factor and abandonment risk are real. A recent release suggests the origin repository is active, but cadence and ongoing Lingoda production usage should be confirmed. Adopting it means owning an upgrade treadmill for a package with no broader community to absorb maintenance.
- What happens if a listener throws during domain event release?
- A throwing listener can obscure the fact that the original write succeeded, creating a durable write with a non-durable side effect. The package does not appear to provide a reconciliation story for this failure mode. You need your own error handling, logging, retry strategy, or outbox pattern if side effects must be reliable.
- What are alternatives to lingoda/domain-events for Laravel?
- Implement the same pattern with native Laravel primitives: record events in aggregates, release them after commit using transaction callbacks, and dispatch Laravel events or afterCommit queued listeners. You can also use model events and observers for simpler cases, or adopt an outbox package when durable delivery matters. The assessment estimates an in-house implementation of this pattern at roughly one to three engineering days.