divineomega/laravel-natural-where
Laravel Natural Where adds expressive, human-readable where clauses to Laravel's query builder, letting you define filters in natural language instead of complex nested conditions. These simple helpers make Eloquent queries easier to write, read, and maintain in Laravel apps.
where(...)->orWhere(...) chains into readable, intent-revealing macros. For teams whose Eloquent scopes are the main source of review friction and bug reports, adopting is cheaper than building and maintaining an internal macro layer.naturalOrWhere macro signals the package's core value is composing OR-conditions across user-driven filters (admin search screens, reporting filters, saved-view builders). If your roadmap includes richer filtering or "advanced search," this is a candidate primitive rather than a bespoke implementation.naturalOrWhere previously not returning the query builder is a correctness issue, not cosmetics — broken chaining can silently drop or misapply conditions in filter logic. If any shipped code path uses this macro, schedule a patch-level bump and a targeted regression check.Adopt when:
naturalOrWhere return-value fix, and your existing usage benefits from correct chaining.Look elsewhere or stay in-house when:
To executives: a small, targeted library that makes our database query code easier to read and review, reducing the chance of subtle filter bugs in admin and reporting screens. The latest release adds compatibility with the newest Laravel version and fixes a defect where one of its query helpers failed to return the query object — the kind of bug that can quietly cause incorrect filter results. Cost is a dependency bump plus a short verification pass.
To engineering: v3.1.0 adds Laravel 13 support (5.6 and 8 retained) and corrects naturalOrWhere to return the builder, restoring chainability. Action: bump to the patch, add a regression test covering any OR-condition filter that uses the macro, and confirm our Laravel version is in the package's tested matrix before relying on it for new filtering work. No breaking API changes indicated in this release.
How can I help you explore Laravel packages today?