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 Model Filter Laravel Package

leocarmo/laravel-eloquent-model-filter

A Laravel package for adding declarative filters to Eloquent models. Define allowed filters once, apply them from request query strings, and keep complex query logic reusable, readable, and easy to test across your application.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Filtering and search as a product surface, not an afterthought. This package is a concrete example of a recurring product decision: which fields are filterable, how filter state maps to URL/query params, whether filters are combinable, and whether filter state is shareable/bookmarkable. Even if you never install it, it gives you a vocabulary for writing those requirements.
  • Build vs. buy for a "list view" layer. For any admin console, back-office table, or list-heavy API, the team will either hand-roll filtering in controllers or adopt a package like this. A PM should force the question explicitly rather than let it be an implicit engineering default, because it affects delivery time, security posture, and long-term maintenance cost.
  • Security and performance requirements around user-supplied query params. The core risk in any Eloquent filter layer is arbitrary column filtering — a user passing ?password_hash=... or an unindexed column that triggers a table scan. This package's pattern (declarative, allow-listed filter definitions) is a good reference for the non-functional requirement you should be writing: only explicitly permitted fields may be filtered, and every filterable field must be indexed.
  • Sequencing of roadmap items. Filtering is typically a prerequisite for dashboards, saved views, exports, and reporting. Deciding early whether filtering is a one-off controller helper or a shared, reusable layer determines whether the second and third list view are cheap or a rewrite.
  • Scope calibration for MVPs and internal tools. For an internal admin panel or a spike, "filters work in an afternoon" is the right bar. For a customer-facing API with SLAs, it is not. This package sits firmly in the first bucket, which is itself a useful data point when scoping.
  • Metrics to attach to the decision: time-to-ship for the first filtered view, number of list views that reuse the filter layer, p95 query latency on filtered endpoints, and number of filter-related bug tickets. These tell you within a quarter whether your chosen approach is holding.

When to Consider This Package

Consider it when:

  • You need simple equality/LIKE filtering on a handful of columns for an internal tool, prototype, or time-boxed spike.
  • Your team is already fluent in Eloquent and wants the filtering logic out of controllers with minimal ceremony.
  • You are willing to vendor or fork it and pin the version, accepting ownership of the code.
  • You are explicitly evaluating the pattern rather than the artifact — reading its source to copy the allow-list/scoping approach into first-party code is a legitimate and often preferable use.

Look elsewhere when:

  • The product is customer-facing or long-lived. With 11 stars, zero dependents, a single maintainer, and no release since August 2018, this is not a dependency you can build a multi-year roadmap on. No dependents means no community validation and no downstream pressure to fix bugs.
  • Framework compatibility matters. A 2018-era Laravel package almost certainly targets Laravel 5.x and will need verification (and likely patching) against Laravel 10/11 and current PHP versions. Budget for that before committing.
  • You need sorting, pagination, relationship includes, or nested/boolean filter logic. Those are table stakes for a real query layer and are the reason maintained alternatives like spatie/laravel-query-builder exist.
  • Your org has a dependency policy requiring active maintenance, security advisories, or a supported-version matrix. This package fails all three.
  • You need documented behavior and support. There is no meaningful support channel here.

Rule of thumb: treat this as a design reference with an optional tactical adoption path, not as an infrastructure choice.

How to Pitch It (Stakeholders)

To executives: This is a small, low-cost pattern for adding filtering and search to list views — the kind of thing that makes admin tools and internal dashboards usable. It is not a strategic bet. The honest framing is: we can borrow the approach for a day or two of engineering effort and own the result, or adopt the package and inherit an unmaintained dependency. Recommend the former. Do not present this as a reason to change roadmap priorities; present it as a way to de-risk and accelerate list-view work already on the roadmap.

To engineering: The package demonstrates a clean, declarative approach to mapping request parameters onto Eloquent scopes with an explicit allow-list of filterable fields. That allow-list is the valuable part — it is both the security control and the performance control. Recommendation: read it, copy the pattern into first-party code (roughly one to two days), and skip the dependency. If a team insists on adopting it, require a fork under our org, a pinned version, a compatibility check against our current Laravel/PHP versions, and a test suite covering the allow-list behavior. If the requirement grows beyond simple filters — sorting, pagination, relationship includes — evaluate a maintained library instead.

The one-line version: Good pattern, abandoned package — use it as a reference, not a dependency.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib