teamq-ec/teamq-doctrine-behaviors
TeamQ Doctrine Behaviors adds reusable Doctrine ORM behavior extensions to PHP projects, bundling common entity traits like timestamps, slugs, soft deletes, and blameable fields into one lightweight package. Drop-in traits and listeners keep models consistent and cut boilerplate.
What this is: teamq-ec/teamq-doctrine-behaviors is a Doctrine ORM behavior library (Timestampable, Blameable, SoftDeleteable, Sluggable, Loggable class extensions) published by a small services organization. In a Laravel context it is only relevant to teams running Doctrine via laravel-doctrine rather than Eloquent. Confidence in scope is medium — the release data contains no README, composer constraints, or usage docs, only a one-line changelog.
Architecture fit: The package occupies a narrow, well-defined seam: it registers Doctrine event subscribers/listeners against the EventManager and mutates entity state at flush time. Coupling to application code is low (opt-in per entity via attributes/annotations), which is architecturally clean. The fit is binary, however: strong if the platform is already Doctrine-backed, near-zero if the codebase is Eloquent-first — in that case adoption means running two ORMs and two mapping/metadata pipelines, a cost far larger than the package itself.
Integration feasibility: Mechanically straightforward (composer require, register subscribers in the Doctrine config or a service provider, annotate entities). Practically blocked: v2.0.0's entire changelog is "Upgrade version" with no migration notes, no diff summary, and no stated breaking changes. A major version bump with an undisclosed delta is the defining fact of this release.
Technical risk: High, concentrated in three areas.
doctrine/orm major (annotations removed in ORM 3), or namespace/attribute changes. We cannot confirm which.NULL into created_at/updated_by or stops filtering soft-deleted rows. Defects surface as data-integrity issues weeks later, not as deployment errors.Key questions for the maintainer (or the diff):
doctrine/orm major, attribute-vs-annotation driver, namespaces, or behavior semantics?Stack fit: Proceed only if the target service already runs Doctrine. Preconditions to verify in the spike: PHP version floor, doctrine/orm major, doctrine/persistence and symfony/* transitive constraints, and attribute-driver support (mandatory if ORM 3). If the roadmap is Eloquent-first, decline — the dual-ORM cost is not recoverable.
Migration path: Pin v1.0.0 in production and treat v2.0.0 as unproven. Read the raw v1.0.0...v2.0.0 diff before any upgrade branch exists; the changelog will not tell us. Then upgrade in an isolated branch with behavior-specific regression tests rather than a generic smoke test: timestamp columns populated on insert and update, blameable user ID correct under HTTP, queue worker, and artisan/CLI contexts, soft-delete filter applied on query and on association hydration, slug uniqueness under concurrent inserts.
Compatibility: Confirm the package's own constraints against our lockfile (composer why, composer outdated --direct), and check whether a major bump forces upgrades in adjacent Doctrine packages — that is the realistic blast radius, not the behavior code itself.
Sequencing:
Maintenance: Release cadence is unknown (two versions, no changelog discipline, no tags-with-notes). Assume best-effort. Budget ongoing owner time for dependency upkeep and expect to read diffs rather than release notes. If the package becomes load-bearing, plan to vendor or fork it — the code surface is small enough that this is cheap insurance.
Support: No commercial support, no SLA. Escalation path is "open an issue with a services shop" or "fix it in our fork." That is acceptable for a low-criticality utility, unacceptable for anything on the financial or audit path without a fork.
Scaling: Listener cost per flush is negligible at normal write volumes. Watch three things at scale: Sluggable's uniqueness lookups on bulk inserts, Loggable's additional write amplification and storage growth, and Blameable's user resolver — which must function in queue, scheduler, and CLI contexts where no authenticated user exists. Bulk-import and backfill jobs should bypass behaviors entirely.
Failure modes (ranked by likelihood × impact):
composer update pulling an unreviewed major → breakage discovered in staging or later.Ramp-up: For a Doctrine-fluent engineer, roughly half a day to first productive use and one to two days to own it confidently. For an Eloquent-only team the package is not the learning curve — Doctrine's Unit of Work, metadata, and DQL are, at one to two weeks. Do not attribute that cost to this dependency when making the build-vs-adopt call.
Recommendation: Conditional. Continue on v1.0.0 with a pinned constraint; do not adopt v2.0.0 until the diff is reviewed and the six questions above are answered. Treat the undocumented major bump as a signal about upstream release hygiene, and size the fork contingency now rather than after it becomes urgent.
How can I help you explore Laravel packages today?