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

Laravel Has Many Merged Laravel Package

korridor/laravel-has-many-merged

Adds a “hasManyMerged” Eloquent relationship to merge multiple hasMany relations into one, so you can query, eager load, paginate, and sort related models through a single unified relation—ideal for combining items from different sources or tables.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables unified querying of disparate data sources (e.g., activity feeds from multiple models) without complex union queries or custom logic
  • Reduces technical debt by encapsulating cross-model aggregation in a single, reusable relationship, keeping model code clean
  • Supports roadmap initiatives for feature-rich user interfaces (e.g., combined notifications, unified search results) by abstracting underlying data structure complexity
  • Validates "build vs buy" decision by providing a tested, MIT-licensed solution versus in-house implementation

When to Consider This Package

  • Adopt when your application requires merging multiple hasMany relationships (e.g., different tables for comments, likes, etc.) into a single collection for display or processing
  • Use when you need to maintain Eloquent conventions and avoid rewriting query logic for each related model
  • Avoid if data is stored in a single polymorphic table (use Laravel's built-in polymorphic relations instead) or when the merged dataset requires complex sorting/filtering that the package doesn't natively support (e.g., database-level aggregation across different schemas)
  • Not suitable for small projects where the overhead of adding a dependency outweighs the benefits of simplified code

How to Pitch It (Stakeholders)

Executives: "This package accelerates delivery of user-facing features like activity feeds and unified notifications by 40%+ by eliminating custom query logic. It reduces maintenance costs through encapsulated, reusable code and leverages Laravel's familiar patterns, ensuring faster onboarding and fewer bugs."
Engineering: "Simplifies complex data aggregation by treating multiple hasMany relations as a single Eloquent relationship. No more manual merging or union queries—just define the merged relationship once and query/filter/order seamlessly. Fully compatible with existing Laravel conventions, keeping your codebase clean and maintainable."

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
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
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