symfonylab/doctrine-orm-extensions-bundle
A Symfony bundle that extends Doctrine ORM with reusable entity behaviors and utilities, helping you cut boilerplate and keep persistence logic clean. Install it via Composer, enable the bundle, and configure the extensions your project needs.
Architecture fit. v1.1.0 is a small, additive release to a Laravel timestamp-precision package. Both changes are Eloquent-layer concerns: MutableMicrosecondsTrait is an opt-in model trait (composition via Laravel's standard trait mechanism, low coupling, no service-provider or container changes implied), and the created_at backfill is a model-lifecycle default. Architecture fit is good for any Eloquent-centric codebase — no new infrastructure, no queue/HTTP surface, no config sprawl.
Integration feasibility. High. A minor-version, purely additive release with no removals or renames is a drop-in upgrade for a ^1.0 constraint. Integration cost is two decisions, not two projects: (a) which models opt into microsecond mutability, and (b) whether the implicit created_at fill is acceptable globally. Only (b) carries any behavioral surface.
Technical risk.
DATETIME(6)/TIMESTAMP(6) on MySQL 5.7+/Postgres. On MySQL <5.6.4, some MariaDB builds, or default DATETIME columns, values truncate silently — the failure is invisible until it corrupts ordering or uniqueness.created_at (medium). "Set current datetime to created_at if not set before" converts an unset timestamp into a populated one. Code that relied on created_at === null as a sentinel (import/backfill pipelines, soft-delete-style auditing, factories asserting nullability, reporting over "not yet materialized" rows) will observe different data without erroring. This is the only item in the release that is not purely additive.Key questions.
created_at fill implemented — model creating event, query builder, or DB default — and does it respect $timestamps = false, saveQuietly(), insert() vs save(), and mass assignment?null?MutableMicrosecondsTrait affect only created_at/updated_at or any declared datetime cast?Stack fit. Best fit: Laravel monolith or API service on Eloquent with MySQL 5.7+/Postgres 12+, where ordered event tables, ledger entries, or audit logs need sub-second resolution. Poor fit: SQLite-in-test setups without precision parity, legacy MySQL, or services that deliberately use created_at nullability as state.
Migration path. Bump the constraint to ^1.1; no code change required to upgrade. Adoption is then incremental and reversible: enable per model rather than wholesale. The created_at fill is the exception — it is effectively global on upgrade, so treat it as a behavior change to be verified, not a feature to be enabled.
Compatibility. Verify in this order: DB engine and existing column precision → Carbon major version → absence of a competing timestamp trait → test-suite assertions touching created_at nullability or exact-timestamp equality.
Sequencing.
created_at assertions.created_at behavior change first.MutableMicrosecondsTrait on one high-value model; verify write→read round-trip preserves microseconds at the column level, not just the object level.Maintenance. Small surface area and a narrow two-change release suggest low churn burden, but also a single-maintainer-style project: pin the minor, read release notes before bumping, and don't depend on undocumented internals. The microsecond work looks like the start of a theme — expect follow-up releases and budget a light review each time.
Support. Two owners. Application developers own trait adoption and the created_at semantics audit. A DBA owns column-type verification and any widening migration — microsecond correctness is a schema property, not a code property, and misdiagnosing truncation as a package bug is the likely support path.
Scaling. Runtime cost is negligible: an in-memory attribute fill and a cast, no extra queries. Storage delta from DATETIME → DATETIME(6) is a few bytes per row; index size and index scan behavior are effectively unchanged. No impact on horizontal scaling.
Failure modes. (1) Silent precision truncation — microsecond values collapse to seconds at the column, producing ordering ties and duplicate-detection gaps in high-throughput event tables; no exception is raised. (2) Implicit created_at masking logic errors — rows that should be "unmaterialized" now look materialized, quietly distorting backfill and reconciliation reports. (3) Fatal trait collision at boot — loud and caught in CI, lowest risk of the three. (4) Test flakiness from exact-equality assertions against microsecond timestamps.
Ramp-up. Low for adoption — a Laravel developer can install the trait on first contact. The real cost is the audit step: for a mid-size codebase, budget roughly half a day to enumerate created_at-dependent code paths and confirm column precision across environments before enabling the trait broadly.
How can I help you explore Laravel packages today?