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.
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:
0.3.1 there is no semver guarantee. Minor bumps may carry breaking changes; the project should budget for reading changelogs on every release.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.Key questions.
callingOnly — stored procedure invocation, named union branch selection, or callback registration?UnionBuilder, and does 0.3.1 add a regression test for this case?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.
callingOnly used as a feature check) — these become dead branches or silent regressions.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.
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.
How can I help you explore Laravel packages today?