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

Virtualcolumn Laravel Package

stancl/virtualcolumn

stancl/virtualcolumn adds database-like “virtual columns” to Eloquent models, letting you define computed attributes that can be queried, sorted, and indexed as if they were real fields. Useful for JSON data, derived values, and cleaner, faster queries.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerates feature delivery for derived data fields (e.g., full_name, status_flags, total_price) without requiring database schema changes or migrations
  • Enables "buy vs. build" decisions by eliminating custom code for computed attributes, reducing engineering effort and technical debt
  • Centralizes business logic in models for consistency across APIs, views, and queries, avoiding duplication in controllers/resources
  • Preserves database normalization by avoiding unnecessary stored columns for transient or calculated values
  • Supports roadmap priorities for clean, maintainable code when scaling complex derived data needs across the application

When to Consider This Package

  • Adopt when:
    • Virtual fields are reused across multiple layers (APIs, Blade templates, Eloquent relationships)
    • Calculations are lightweight (e.g., string concatenation, arithmetic) and don’t require SQL-level optimization
    • Schema modifications are restricted (legacy systems, compliance constraints) or migrations are costly
    • Consistency is critical (e.g., financial metrics, status logic) to prevent divergent implementations
  • Avoid when:
    • The virtual column must be used in SQL WHERE/ORDER BY clauses (PHP-based computation can’t leverage database indexes)
    • Computation is resource-heavy (e.g., complex aggregations across large datasets) where database-side optimization is essential
    • The project is trivial (e.g., single-use calculation in one controller) where package overhead outweighs benefits

How to Pitch

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation