exeko/laravel-simple-query-filter
A lightweight Laravel package for adding simple, declarative query-string filters to Eloquent models, letting you turn request parameters into reusable filter logic with minimal code.
Architecture fit
Integration feasibility
use statement. There is no infrastructure to provision and no runtime service to operate. The realistic engineering effort is a half-day spike, not a project.composer.json version constraints target Laravel 6/7 and PHP 7.x. Modern Laravel (10/11/12) and PHP 8.2+ compatibility is unverified and must be proven, not assumed.Technical risk
orderBy on arbitrary columns). We cannot assess this without reading the source.whereHas/whereRelation, stricter typing in newer versions); an unmaintained trait may emit deprecations or break silently.Key questions
filter[...] array, operator prefixes (gte:, like:)? Is it documented?request() inside the model, or accept an array of filters as an argument? The latter is a materially better design.composer.json constraints for laravel/framework and php, and does it have illuminate/* split-package constraints?Stack fit
spatie/laravel-query-builder is the de facto standard and has active maintenance, tests, and an allowlist-first design).Migration path
app/Models/Concerns/ under your own namespace, with attribution and license check) rather than adding a Composer dependency. This preserves the ergonomics while eliminating the abandonment and supply-chain risk, and lets us add the allowlist and the array $filters signature that the original may lack.Compatibility
request() in the model, treat that as a defect to be patched, not a feature.Sequencing
App\Models\Concerns, add the allowlist, harden the signature to accept an explicit filter array, add tests, document the convention in the team's Laravel style guide.Maintenance
Support
Scaling
LIKE '%…%' scans, and sort-by-unindexed-column. At low data volume this is invisible; at a few million rows per table it becomes p95 latency. Any adoption should come with a rule that filterable columns must be indexed and that free-text search is out of scope.Failure modes
where or orderBy; error messages that leak schema.Ramp-up
TPM recommendation: treat this as a pattern reference, not a dependency. The reusable idea — declarative model-level query filters — is worth adopting; the specific artefact carries abandonment, security, and compatibility risk disproportionate to its ~100 lines of value. Vendor and harden it, or adopt a maintained equivalent, and document the filterable-column allowlist as the governing standard.
How can I help you explore Laravel packages today?