bentools/doctrine-watcher
Monitor Doctrine entity inserts and updates with a lightweight event subscriber. Watch specific classes and properties, get a changeset with old/new values or additions/removals, and run callbacks to react to changes (e.g., email or roles updates).
User::email or User::roles separately) rather than broad entity-wide hooks.EventManager, which is standard in Laravel (doctrine/orm) and Symfony. Minimal setup required (1–2 lines to register the subscriber).EventManager (e.g., in a service provider or bundle).postPersist/postUpdate behavior).postRemove events) or collections (only scalar properties).PropertyChangeset methods).email vs. roles separately)?prePersist/preUpdate suffice for simpler needs?Gedmo/DoctrineExtensions) or custom repository listeners.boot() method using Laravel’s doctrine.orm.entity_manager.doctrine-watcher-bundle for simplified setup (recommended).kernel.event_subscriber tag.EventManager access (e.g., via Doctrine\ORM\EntityManager).postPersist/postUpdate overhead).User roles) to test stability.email, status).2.10.0). Use a compatibility matrix if possible.Gedmo), ensure no conflicts with postPersist/postUpdate events.postPersist/postUpdate fire after other listeners (e.g., audit loggers). Use EventManager::getListeners() to debug order.postPersist/postUpdate. Avoid:
0.2.* in composer.json to avoid accidental updates.postPersist/postUpdate.PropertyChangeset objects to verify payloads (e.g., getOldValue(), getNewValue()).EventManager debugging tools to inspect event order and subscribers.postPersist/postUpdate events trigger after DB writes, so no direct DB impact. However, callbacks might query the DB (e.g., fetching related entities).try-catch blocks to log errors without failing the operation.How can I help you explore Laravel packages today?