foxws/laravel-scout-builder
A fluent query builder for Laravel Scout that lets you construct search queries with familiar chainable methods, making it easier to filter, sort, and paginate searchable Eloquent models while keeping Scout integrations clean and expressive.
Architecture fit: foxws/laravel-scout-builder is an extension layer over Laravel Scout that adds a fluent filter/operator DSL on top of the underlying search driver (Meilisearch, Typesense, Algolia, or the database engine). It does not replace Scout; it wraps query construction, which keeps it architecturally low-risk — it sits at the application/service boundary and is swappable. Release 1.2.0 tightens two parser behaviors: nullable filters that are fully ignored are now skipped entirely rather than emitted, and unknown dynamic operator tokens degrade to equality matching instead of being passed through or dropped. Both changes improve resilience of the DSL against real-world input, but they also shift query semantics in edge cases.
Integration feasibility: Straightforward. Composer-installable, Laravel package auto-discovery, no infrastructure changes required. The main effort is validating that existing where/filter chains produce identical result sets after upgrade, particularly any code paths that relied on ignored nullable filters being present in the compiled query.
Technical risk: Low-to-moderate. The release is non-breaking at the API level (no signature or config changes advertised), but it is behavior-changing at the query level:
>= mistyped as => now becomes an equality match rather than an error).Key questions:
Stack fit: Target Laravel 10/11/12 on PHP 8.1+, with Scout 10.x and a driver already chosen. The package is agnostic to the driver but behavior of the fallback path should be verified per driver, since equality semantics differ between Meilisearch, Typesense, and Algolia (notably around string normalization and numeric coercion).
Migration path:
^1.2 in a feature branch; run the existing search test suite.Compatibility: No advertised breaking changes, so a minor-version bump is appropriate. The real compatibility surface is semantic, not syntactic — existing filter expressions remain valid but may resolve differently. Teams with user-supplied filter input (admin search consoles, public faceted search) should treat this as a behavior change requiring QA sign-off.
Sequencing: Adopt in a low-traffic service or behind a feature flag first. Because the fallback loosens matching, roll out alongside observability on result counts so that unintended broadening is detectable. If the DSL is exposed to end users, pair the upgrade with input validation on operator tokens so the fallback is a safety net rather than the primary error-handling strategy.
Maintenance: Small, single-maintainer package (foxws/francoism90) with an infrequent release cadence. Low dependency surface (Scout + driver SDK), which keeps upgrade churn manageable, but bus-factor risk is real — pin versions and keep a fork/PR path open for critical fixes.
Support: Community-supported via GitHub issues; no commercial backing. The 1.2.0 changes reduce the likelihood of hard failures on odd input, which should lower support load, but the silent equality fallback can increase debugging time when results look "too broad" with no error to point at.
Scaling: Negligible runtime overhead — query building is in-process string/array construction. Scaling characteristics are entirely inherited from the search driver. No new network calls, caching layers, or background work introduced.
Failure modes:
Ramp-up: Low for teams already fluent in Scout — the DSL is additive and idiomatic. Budget half a day for a engineer to read the README, write regression tests for the two changed behaviors, and validate against the chosen driver. Teams new to Scout should factor in driver-specific filter syntax learning separately, since the package abstracts but does not eliminate that knowledge.
How can I help you explore Laravel packages today?