eloquent-filter/filter
Eloquent Filter adds request-driven filtering to Laravel Eloquent models. Define allowed filters and custom filter classes, then filter queries through query-string parameters, keeping APIs, admin panels, and search endpoints clean, composable, and easy to maintain.
Architecture fit. The package is a thin, Laravel-native convenience layer: a trait on Eloquent models plus an abstract filter class that resolves query-string parameters into filterBy* methods on the query builder. It slots into the standard Laravel request → controller → Eloquent path with no new infrastructure, no external service, and no datastore assumptions. The trade-off is architectural: it moves HTTP input interpretation into the persistence layer. Applications already using query objects, repositories, or a specification pattern will find it competes with existing abstractions rather than composing with them. For CRUD-heavy admin surfaces and read APIs with a bounded, well-understood set of filterable fields, it removes a meaningful amount of boilerplate. For CQRS, event-sourced, or multi-datastore systems, it is a poor fit. Release 4.5.6 does not touch this calculus — it is a framework-compatibility change only, no new abstraction, no API surface change.
Integration feasibility. Low effort to prove out: composer require, publish config, add the trait, define one filter class, hit an endpoint. A spike is measured in hours, not days. The real feasibility question is not "can we wire it up" but "can we constrain it," and that is a design decision we make, not one the package makes for us. 4.5.6 widens the supported framework range to include Laravel 13.x, which removes a previously plausible blocker if our roadmap has us crossing that boundary within the package's useful life.
Technical risk.
count(*) on large result sets. The package provides no guardrails.dependents: 0 means no downstream package depends on it, so there is no transitive validation and no ecosystem pressure hardening edge cases. That is not disqualifying — MIT license means we can fork and vendor — but it shifts long-term ownership risk onto us.Key questions.
Stack fit. Strong for a conventional Laravel monolith or modular monolith on Eloquent, especially where the API contract is "query params map to filters" (filter[status]=active&sort=-created_at). Weak where the query surface is small and stable enough that hand-written scopes are cheaper than a framework, or where multiple teams own different query semantics and need a shared, schema-validated contract. The framework-version spread now supported means fit is less contingent on where we sit in the Laravel upgrade cycle — the package is unlikely to be the thing that pins us to an older major.
Migration path. Do not adopt it as an architectural decision; adopt it as an adapter. Concretely:
This keeps the swap cost to "replace the adapter" rather than "rewrite the query layer," which is the correct posture given the maintenance risk. The adapter posture also absorbs the 4.5.x cadence: a patch that only widens framework support is a no-op for us, and a patch that changes resolution behavior is contained to code we already own and test.
Compatibility. Verify PHP constraint against runtime, Laravel major version support (13.x now declared; confirm our current major is still inside the supported range and that the lower bound is not about to be dropped), and static analysis behavior (Larastan against dynamically resolved methods will need baselines or stubs). For 4.5.6 specifically: confirm whether the release widened the composer constraint only or also added Laravel 13 to the CI matrix — the former is a claim, the latter is evidence, and we should weight them differently in the ADR. If we are not yet on Laravel 13, treat 4.5.6 as a low-urgency patch: schedule it on our cadence, not upstream's, and gate it on our existing contract tests passing unchanged. Check for namespace collisions with existing traits and for conflicts with any search/scout integration. Confirm the config file publishes cleanly and that per-environment configuration is possible.
Sequencing.
Maintenance. Small dependency footprint, MIT licensed, so worst case we fork and carry it — a bounded, contained cost. The 4.5.6 release is a mild positive on maintenance: a solo maintainer shipping same-week support for a new Laravel major is the behaviour you want from a dependency you cannot influence. Budget for: pinning the version, upgrading on our cadence rather than upstream's, and reviewing filter classes in code review the same way we review migrations. The growing maintenance surface is not the package; it is the accumulated filter classes, each of which is a small piece of API contract with an implicit index requirement. Add one line to the maintenance checklist: read every upstream changelog, including patches, because framework-support changes have shipped in patch versions.
Support. Day-to-day support burden is developer-facing: conventions, examples, and "why isn't my filter firing" questions. Production support burden is different in kind — incidents will present as slow endpoints or 500s on malformed parameter shapes, and tracing those back to a specific filter requires query logging and an ability to disable a filter fast. We need a runbook entry: how to disable a filter via config without a deploy, and how to correlate a slow query to a filter class. Nothing in 4.5.6 changes the support profile.
Scaling. Application tier scales horizontally without issue; the database is the constraint. Every filter is a potential WHERE/ORDER BY against a column that may not be indexed, and the combinatorial space of filter combinations means index planning must be driven by observed query patterns, not by the filter list. Mitigations: per-endpoint maximum filter count, statement timeouts, keyset pagination for large result sets, read replicas or caching for hot filter combinations, and an index review gate on every new filter PR.
Failure modes.
Ramp-up. A Laravel-competent engineer is productive in roughly half a day. Establishing the allowlist, validation contract, test patterns, and observability is closer to one sprint of one engineer's time. The adoption cost is genuinely low; the governance cost is the real investment, and it should be scoped and owned explicitly rather than absorbed implicitly by whoever writes the first filter. 4.5.6 adds no ramp-up cost — it is a constraint change, not a behavioural one.
How can I help you explore Laravel packages today?