Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Behaviors Laravel Package

awstudio/doctrine-behaviors

awstudio/doctrine-behaviors provides reusable Doctrine behavior traits for Laravel and PHP applications, helping add common entity features such as timestamps, soft deletes, slugs, blameable users, sorting, and tree support with less boilerplate.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Bottom line: This package is a 2018-era Doctrine ORM trait library with a single star, zero dependents, and no release in roughly seven years. It is not a Laravel package in any meaningful sense — it is Doctrine2 infrastructure that a Laravel application would only touch if it had already replaced Eloquent with Doctrine via a bridge such as laravel-doctrine/orm. For a Laravel/PHP team it should be treated as rejected as a direct dependency, and considered only as a candidate for an internally owned fork if the Doctrine architecture is already a hard constraint.

Architecture fit

  • The library's model is trait + marker interface + Doctrine event subscriber (timestampable, blameable, soft-deletable, sluggable, translatable, loggable, tree, uuid). It hooks into Doctrine\ORM\EventManager, not into Laravel's service container, facades, or Eloquent lifecycle.
  • None of it composes with Eloquent. Eloquent already ships timestamps, SoftDeletes, attribute casting, and observer/event hooks that cover most of the same ground natively; slugs are covered by maintained packages like spatie/laravel-sluggable. If the application is Eloquent-based, this dependency delivers zero value.
  • If the application is Doctrine-based inside Laravel, the package is architecturally relevant but redundant with the more widely used and actively maintained gedmo/doctrine-extensions and, for the subset of behaviors, KnpLabs/DoctrineBehaviors (the apparent upstream of this fork).

Integration feasibility

  • Feasible only with work. Subscribers must be registered on the Doctrine EntityManager through the bridge's config, and the traits must be applied per entity. That is straightforward configuration, not deep integration.
  • The real friction is version drift: a 2018 release targets PHP 7.x and Doctrine ORM 2.5–2.7, using annotation-era mapping and helpers (ClassUtils, annotation driver assumptions) that Doctrine ORM 3 has removed or deprecated. Laravel 11/12 requires PHP 8.2+, and modern Doctrine installs resolve to ORM 3.x. Expect hard incompatibilities, not just warnings.
  • Provenance needs verification: confirm the diff against upstream before trusting the fork.

Technical risk

  • Abandonment risk: high. No maintainer, no releases, no dependents, no CVE monitoring. Any Doctrine or PHP upgrade becomes the team's problem.
  • Supply-chain risk: moderate. Low-visibility fork with a single star; installing it means granting code execution inside the ORM event pipeline. Prefer a vendored fork pinned to a reviewed commit.
  • Behavioral risk: medium. Subscribers mutate entities implicitly (timestamps, slugs, soft-delete filters). Implicit magic in the persistence layer is hard to debug and interacts badly with bulk operations, raw SQL, and fixtures.
  • Translatable/loggable risk: high. These are the behaviors with the most schema and query implications, and the ones most likely to have rotted against current ORM internals.

Key questions

  1. Does this application actually run Doctrine, or is this being evaluated as an Eloquent package? If Eloquent, stop here.
  2. Which specific behaviors are needed, and can Eloquent (or gedmo/doctrine-extensions) cover them with maintained code?
  3. Is the fork materially different from KnpLabs/DoctrineBehaviors, and is that upstream still viable?
  4. What Doctrine ORM and PHP versions are pinned today, and what is the upgrade horizon?
  5. Who owns this code for the next three years if we adopt it?

Recommendation: Do not add as a direct dependency. Run a 2–3 day spike to confirm which behaviors are genuinely required; default to Eloquent-native equivalents. If Doctrine is non-negotiable, evaluate gedmo/doctrine-extensions first and treat this package as a fork-only, internally owned fallback.

Integration Approach

Stack fit

  • Only fits a Laravel + Doctrine stack: Laravel 10/11/12 with laravel-doctrine/orm (or equivalent bridge), PHP 8.x, Doctrine ORM 2.x/3.x.
  • Does not fit Eloquent-first applications at any layer — no service provider, no config, no Eloquent traits.
  • Composer-level fit requires an explicit repository entry (VCS or path repo) since a fork this obscure should not be pulled from Packagist blindly.

Migration path

  1. Inventory behaviors in use. Enumerate which traits are actually needed (likely timestampable, soft-deletable, sluggable; possibly translatable). Most teams need two or three, not the full set.
  2. Map to native equivalents. For Eloquent: timestamps, SoftDeletes, spatie/laravel-sluggable, observers. For Doctrine: gedmo/doctrine-extensions (softdeleteable, timestampable, sluggable, blameable, tree, translatable).
  3. Fork, don't depend. If a gap remains, fork into the org namespace, drop unused traits, replace annotation-era metadata access with attribute/EntityManager-based lookups, add PHP 8.2+/ORM 3 support, and tag internally.
  4. Migrate entity by entity behind feature flags where schema changes are involved (soft-delete columns, translation tables), with reversible migrations.

Compatibility

  • Expect breakage on Doctrine ORM 3: annotation driver removal, ClassUtils deprecation, Doctrine\Common\Persistence namespace moves, and typed-property assumptions in traits.
  • Trait-based composition is largely orthogonal to Laravel version, so Laravel upgrades themselves are low risk; the ORM version is the binding constraint.
  • Translatable and loggable carry schema obligations (translation tables, audit tables) that must be designed before adoption, not after.

Sequencing

  1. Spike and behavior inventory (2–3 days).
  2. Native/gedmo feasibility check against each required behavior (3–5 days).
  3. Decision gate: adopt maintained alternative vs. fork.
  4. If forking: hardening, ORM 3 compat, tests (2–4 weeks).
  5. Pilot on one low-risk entity, then roll out with reversible migrations.

Operational Impact

Maintenance

  • Upstream maintenance is effectively zero. Adopting without a fork transfers all future maintenance in-house by default, without the benefit of having planned for it.
  • Fork ownership must be explicit: a named owner, a pinned commit, and a documented patch list against upstream. Otherwise the fork silently diverges and becomes unmaintainable.
  • Budget recurring effort for Doctrine major-version bumps; this library will not track them.

Support

  • No vendor, no community, no issue triage. Internal engineers are the only escalation path.
  • Debugging is non-trivial: behavior is applied by event subscribers at flush time, so problems surface as unexpected column values or missing rows rather than as obvious errors.
  • Onboarding cost is real — engineers must understand Doctrine's event system, not just Laravel conventions.

Scaling

  • Event-subscriber overhead per flush is modest and generally not the bottleneck; the behaviors themselves are simple.
  • Translatable and tree behaviors introduce query complexity (joins per locale, recursive/hierarchical queries) that can degrade at scale and are poorly optimized in an unmaintained codebase.
  • Soft-delete filters silently change result sets, which complicates reporting, exports, and analytics reads against the same tables.

Failure modes

  • Silent no-op: subscriber not registered or trait applied without the marker interface → timestamps/slugs simply don't populate. Detected late, in production.
  • Version incompatibility: ORM 3 upgrade throws on removed APIs at bootstrap or first flush — loud but blocking.
  • Soft-delete leakage: raw SQL, bulk updates, or unconfigured filters bypass the soft-delete filter and return deleted rows.
  • Slug collisions: unmaintained slug generation under concurrency produces unique-constraint violations.
  • Translation drift: missing translations return null or fall back unpredictably, surfacing as blank UI in specific locales.
  • Unpatched dependency: no CVE monitoring means vulnerabilities are discovered by accident.

Ramp-up

  • 3–5 days for an engineer already fluent in Doctrine to apply traits and register subscribers.
  • 1–2 weeks for a Laravel-native engineer to become productive with Doctrine's unit of work, metadata, and event system.
  • Add 2–4 weeks if the fork path is chosen, including ORM 3 compatibility work and a test suite.

Net position: Low strategic value, high latent cost. The correct TPM move is to redirect the requirement to maintained Laravel-native or gedmo equivalents and reserve this package for a fork-only contingency with a funded owner.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package