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

Laravel Eloquent Union Builder Laravel Package

open-southeners/laravel-eloquent-union-builder

Laravel Eloquent Union Builder adds fluent UNION query support to Eloquent, letting you combine multiple models or queries into one result set with ordering and pagination. Ideal for unified feeds, search results, and mixed-model listings.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The surface area touched (UnionBuilder::callingOnly) indicates a package that extends or wraps Laravel's query builder to compose UNION queries, with an added callingOnly modifier that presumably restricts which union branches are "called" (likely stored procedure/function invocation or a named-branch filter). Architecturally this sits at the data-access layer — low blast radius, but high call frequency, so defects here surface as application-wide query failures rather than localized ones. Fit with a standard Laravel service/repository layering is direct; no framework-level entanglement is implied.

Integration feasibility. High. This is a patch-level change: a null-safety guard on an existing method. There is no signature change, no removed method, and no migration implied. Expected effort is a dependency bump plus regression run — hours, not days.

Technical risk. Low for the fix itself, moderate for the package overall:

  • Pre-1.0 instability. At 0.3.1 there is no semver guarantee. Minor bumps may carry breaking changes; the project should budget for reading changelogs on every release.
  • Behavioral ambiguity of "null-safe." The critical unknown is whether callingOnly on a null builder now (a) silently no-ops, (b) returns an empty/identity builder, or (c) throws a controlled exception. Case (a) converts a loud failure into a silent misconfiguration — a worse outcome for production data correctness than the original crash. This must be verified against the diff, not assumed.
  • Under-tested chaining paths. The existence of this bug implies that null/partial-state builder chains were not covered by the test matrix. Assume adjacent edge cases in union composition remain unexercised.

Key questions.

  1. What is the documented contract of callingOnly — stored procedure invocation, named union branch selection, or callback registration?
  2. What is the new null-path semantics (no-op vs. exception vs. default), and is it documented?
  3. Which Laravel and PHP versions are supported, and is the package actively maintained (release cadence, issue responsiveness, bus factor)?
  4. Does the null guard mask a real upstream condition (e.g. a union built before its source query is attached) that should instead be validated earlier?
  5. What is the test coverage of UnionBuilder, and does 0.3.1 add a regression test for this case?

Integration Approach

Stack fit. Standard Composer/Laravel dependency. Consumed via the service container and query builder macros or subclass; no queue, cache, or filesystem coupling implied.

Migration path. None required. 0.3.1 is a drop-in replacement for 0.3.0; no schema, config, or API changes are indicated. Because the package is pre-1.0, pin to an exact version (0.3.1) or rely on a committed lockfile rather than a floating ^0.3 constraint in production.

Compatibility. Verify the package's declared Laravel and PHP constraints against the host application before bumping; pre-1.0 packages frequently narrow support ranges in patch releases without flagging it as breaking. Run the existing union-query integration tests specifically, not just the full suite — a null-safety change can be masked by fixtures that never exercise the null path.

Sequencing.

  1. Review the 0.3.1 diff and confirm the null-path semantics.
  2. Bump in a staging branch; run union-heavy and reporting/export query suites.
  3. Audit call sites for any code that depended on the previous failure mode (e.g. try/catch around callingOnly used as a feature check) — these become dead branches or silent regressions.
  4. Promote to production with a rollback pin to 0.3.0 available; monitor query error rates and, more importantly, result-set correctness on union-backed endpoints for one release cycle.

Operational Impact

Maintenance. The dependency is small and single-purpose, so maintenance cost is low — but pre-1.0 status plus a null-safety bug in a core builder method suggests a thin test suite. Budget an hour per release to read changelogs and skim the diff; do not auto-merge dependency bots for this package.

Support. The fix removes a class of hard failures (fatal errors on chained union construction) and should reduce support tickets tied to intermittent query-building errors. The offsetting risk is support tickets of the "wrong results, no error" variety if the null path is a silent no-op.

Scaling. No runtime cost — the guard is a branch check. Scaling exposure is indirect: union-based reporting queries are typically the ones that grow unbounded, so if callingOnly governs which branches execute, a silent no-op could mean unused branches are still executed, inflating query cost at high data volumes. Confirm behavior before relying on this method as a performance control.

Failure modes.

  • Silent no-op on a null builder, producing over-broad or incorrect result sets (highest severity, hardest to detect).
  • Builder state leakage across union branches if the guard returns a shared instance rather than a clone.
  • Unpinned version drift pulling an incompatible 0.4.x under a caret constraint.
  • Abandonment risk — a pre-1.0 package in the data-access path with no maintained fork is a latent migration project.

Ramp-up. Low. A Laravel-fluent engineer is productive within a day. The non-obvious onboarding item is the null semantics change in 0.3.1 and the correct pattern for constructing multi-branch unions; that belongs in the team's internal query-builder notes, not the package README.

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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log