Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Eloquent Filters Laravel Package

pricecurrent/laravel-eloquent-filters

Laravel Eloquent Filters adds reusable, request-driven filters to Eloquent queries. Define filter classes, map query-string parameters, and compose clean, testable filtering logic for search pages, APIs, and admin lists without bloating controllers or models.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature delivery for filtering and faceted list views. This package is the layer behind "filter by status, date range, owner, tag, price range" on any Eloquent-backed list endpoint — admin consoles, internal ops tools, customer-facing catalogs, and public/partner APIs. That makes it a direct enabler of a recurring, high-visibility feature class rather than a one-off utility.
  • Build vs. buy (adopt) for the query-string layer. Every team eventually writes its own request-to-query translation: parsing params, whitelisting fields, handling relationships, composing constraints. This package replaces that bespoke code with declarative, per-model filter classes. The decision it informs is "adopt a small MIT package vs. spend 1–3 sprint-weeks building and maintaining our own filtering abstraction."
  • Roadmap sequencing. Because filtering is usually a prerequisite for reporting, saved views, exports, and segmented notifications, adopting this early can unblock several downstream roadmap items instead of each team re-solving filtering independently.
  • Standardization across squads. A class-per-filter convention gives multiple teams a shared, reviewable pattern for how filtering is expressed — useful if you want consistent API query semantics across services rather than four different ad-hoc implementations.
  • Risk posture on third-party dependencies. With ~176 stars and a 1.4 score, this is a low-adoption dependency. The PM decision is not "is it good?" but "is the capability worth a thin, isolatable dependency with a modest community, and can we contain the risk if it stalls?" MIT licensing removes commercial and legal friction; the residual risk is maintenance and bus factor, which is manageable if the usage is wrapped behind an internal interface.

When to Consider This Package

Adopt when:

  • The product is a Laravel application using Eloquent as its primary data access layer — this package is idiomatic Laravel and adds little conceptual overhead.
  • Filtering needs are structured and enumerable: a known set of filters per model, defined by the team, rather than fully arbitrary user-driven query construction.
  • You want filters to live as first-class, unit-testable classes rather than controller closures or a growing if tree in a query scope.
  • The team is small-to-mid and prefers low-ceremony OSS over a platform or commercial search service.
  • Filtering is a supporting capability, not the core product differentiator — you want it done well and cheaply, not perfected.

Look elsewhere when:

  • You need search relevance, typo tolerance, aggregation-heavy faceting, or large-scale full-text — reach for Laravel Scout with Meilisearch/Algolia/Elasticsearch instead; this package filters a database, it does not replace a search engine.
  • You require vendor support, SLAs, or a large maintainer community — the star count and release cadence here imply a small maintainer base; if procurement or risk policy mandates a support contract, this will not clear the bar.
  • Filtering must be fully dynamic or user-authored (arbitrary field/operator combinations, saved query DSLs) — you will likely outgrow a declarative filter-class model and should design a query layer deliberately.
  • Your access model requires fine-grained, per-field, per-tenant authorization inside every filter — you can build this on top, but validate that the package's extension points are enough before committing; otherwise a custom abstraction is cleaner.
  • Your stack is API-first with GraphQL, or non-Eloquent data sources — the value proposition is Eloquent-specific and largely evaporates.
  • The team already standardizes on a comparable query-builder package and the migration cost outweighs consolidation benefit.

Evaluation gate before adoption: a short spike on one real endpoint, confirming (a) the filter definition style matches how your team thinks, (b) it composes with your authorization and pagination layers, and (c) you can wrap it so a future swap is a contained change. Treat the low adoption score as a prompt for that spike, not an automatic rejection.

How to Pitch It (Stakeholders)

For executives: Filtering and search on list screens is a feature we will build repeatedly across the product — admin tools, customer dashboards, partner APIs. Today each team solves it differently, which costs engineering time and produces inconsistent behavior. This is a small, MIT-licensed Laravel package that gives us a single, conventional way to express filters, so we ship those screens faster and with less custom code to maintain. There is no license cost and no vendor lock-in; the trade-off is a small open-source community, which we mitigate by keeping it behind a thin internal layer so it can be replaced if it stops being maintained. Recommendation: pilot it on one non-critical endpoint this cycle, measure the time saved against our current approach, and decide on broader adoption from that evidence.

For engineering: This gives us declarative, class-per-filter definitions on top of Eloquent, keeping controllers thin and filtering logic testable and reusable across endpoints. It is a narrow, idiomatic Laravel dependency — no new infrastructure, no runtime service, no schema changes. We should adopt it behind an internal interface so the framework stays a detail rather than a commitment, unit-test the filter classes directly, and pin the version. It is not a substitute for a real search engine: if we later need relevance ranking or heavy faceting, that is a separate decision and this layer can coexist with or be swapped for Scout-backed search. Please run a one-endpoint spike first, specifically checking how it composes with our authorization scopes and pagination, before we standardize on it.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource