Weave Code
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

Formula Doctrine Bundle Laravel Package

cryonighter/formula-doctrine-bundle

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Performance Optimization: Eliminates redundant database columns for computed fields, reducing storage costs and improving query efficiency by leveraging SQL-level calculations (e.g., aggregations, subqueries).
  • Developer Productivity: Enables declarative computed fields (via #[Formula]) without manual hydration logic or DQL/QueryBuilder workarounds, aligning with Symfony’s annotation-driven ORM patterns.
  • Roadmap for Analytics Features: Accelerates development of read-heavy features (e.g., "customer lifetime value," "order frequency") by abstracting away SQL complexity behind clean entity properties.
  • Build vs. Buy: Avoids custom middleware or event listeners for computed fields, reducing technical debt compared to bespoke solutions.
  • Use Cases:
    • Derived metrics (e.g., #[Formula('SUM(o.amount)')] public float $totalSpent).
    • Denormalized data (e.g., caching aggregations like productStockLevel).
    • Read-only fields tied to complex joins/subqueries (e.g., lastOrderDate).

When to Consider This Package

  • Adopt when:
    • Your Symfony app uses Doctrine ORM and needs read-only computed fields without physical columns.
    • You prioritize SQL efficiency (e.g., avoiding N+1 queries for derived data).
    • Your team prefers declarative syntax over manual hydration logic (e.g., PostLoad events).
    • You’re targeting PHP 8.2+ and can tolerate early-stage packages (low stars but MIT-licensed).
  • Look elsewhere if:
    • You need writeable computed fields (this is read-only).
    • Your queries require dynamic SQL (e.g., runtime parameters beyond {this}).
    • You’re using non-Doctrine ORMs (e.g., Eloquent, Propel).
    • You need high maturity (package lacks dependents/tests; evaluate for greenfield projects).
    • Your use case involves complex caching (consider Symfony Cache component instead).

How to Pitch It (Stakeholders)

For Executives: "This bundle lets us add computed fields (like 'customer order count' or 'total spend') directly to our Doctrine entities—without extra database columns or slow application-layer logic. It’s like Hibernate’s @Formula for Symfony, cutting storage costs and query complexity. Low risk (MIT license, PHP 8.2+), high reward for analytics-heavy features."

For Engineering: *"Symfony bundle that auto-wires #[Formula] support for Doctrine, handling SQL walkers and metadata listeners. Key benefits:

  • Zero boilerplate: Annotate entities (e.g., #[Formula('(SELECT ...)')]) and it just works.
  • Performance: Computations run at the SQL level, avoiding N+1 or lazy-loading overhead.
  • Maintainability: Keeps derived logic in the entity layer, not scattered across repositories/services. Tradeoff: Early-stage package (0 stars), but minimal risk for read-only use cases. Ideal for greenfield or low-criticality features first."*
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.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle