rapidwebltd/improved-polymorphic-eloquent-builder
Improve polymorphic relationship querying in Laravel with a cleaner Eloquent builder API. This package helps you filter and chain queries across morph types more expressively, reducing boilerplate when working with polymorphic models.
morphTo side of a relation can be constrained, eager-loaded, and filtered.whereHasMorph, whereDoesntHaveMorph), which is functionally the territory a 2018 package like this was filling. The default answer should be use the framework; adoption requires a specific, documented gap.Consider only when all of the following hold:
Look elsewhere when any of the following is true (the common case):
whereHasMorph / whereDoesntHaveMorph and morph-aware eager loading natively. No package required.For executives: This package solves a real but narrow problem — making polymorphic database relationships easier to query in Laravel. The important finding is that the framework has since absorbed this capability, and the package itself has had no release since early 2018 with negligible adoption. Recommendation: do not adopt. The cost is not the code, it is the ownership — an unmaintained dependency in a core data-access path, plus non-standard LGPL licensing to review. There is no capability here worth paying that price for.
For engineering: The value this package offered was constraining and eager-loading the morph side of a morphTo relation, which native Laravel now handles via whereHasMorph/whereDoesntHaveMorph and morph-aware eager loading. For any code that would have used it, implement the equivalent with native builder methods plus a small local scope or trait, covered by tests. Where the package already exists in a codebase, treat it as an upgrade-blocker marker: replace usages as part of the next Laravel upgrade and remove the dependency, rather than patching around it. If a legacy constraint forces temporary retention, time-box it with an explicit exit criterion tied to the framework upgrade.
How can I help you explore Laravel packages today?