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
Query Filter Laravel

Query Filter Laravel Laravel Package

liqrgv/query-filter-laravel

A Laravel package for building expressive, reusable query filters. Apply request-based filtering, sorting, and search to Eloquent queries with clean, composable filter classes—ideal for APIs and admin lists.

View on GitHub
Deep Wiki
Context7

Change your Request into Query builder

Frequently asked questions about Query Filter Laravel
What is liqrgv/query-filter-laravel used for?
It is a Laravel package for turning request query strings into Eloquent query builder logic. It supports request-based filtering, sorting, and search using composable filter classes, which makes it suitable for APIs and admin lists. Architecturally it sits at the controller or FormRequest boundary rather than replacing Laravel's middleware, validation, or resource layers.
How do I install liqrgv/query-filter-laravel?
Install it with composer require liqrgv/query-filter-laravel. The technical evaluation describes a low-surface install with optional config publishing and one or two lines per controller. Check the repository README and composer.json for the exact service-provider, config, and version-constraint steps before adding it to an existing application.
Does it support request-based filtering, sorting, and search for Laravel APIs?
Yes. The package is described as applying request-based filtering, sorting, and search to Eloquent queries with clean, composable filter classes. That makes it a fit for JSON APIs and admin list endpoints where query parameters drive the result set. Verify the exact query-string syntax, operators, and filter-definition conventions in the package documentation.
Which Laravel and PHP versions does query-filter-laravel support?
The provided overview does not list a supported Laravel or PHP version matrix. The technical evaluation specifically flags Laravel 11/12 and PHP 8.2+ compatibility as unknowns to verify. Check composer.json, README, and release tags for exact constraints before assuming compatibility with your application.
Is query-filter-laravel safe for user-controlled filter and sort parameters?
Treat it like any package that maps request input onto query columns and verify a deny-by-default allow-list for filterable and sortable fields. Check that relation paths are constrained, operators are enumerated rather than parsed from arbitrary strings, and no whereRaw or orderByRaw path is reachable from user input. The evaluation flags missing allow-listing as a SQL-injection or data-exposure risk, and expensive sorts on unindexed columns as a query-cost concern.
How does liqrgv/query-filter-laravel compare with spatie/laravel-query-builder?
spatie/laravel-query-builder has broad adoption, explicit allow-listing, and documented JSON:API-style semantics. liqrgv/query-filter-laravel is a much smaller package focused on composable request-based filter classes. Confirm whether it is intended as a substitute or a complement to your existing query-builder conventions before standardizing on it.
Does it support filtering on relationships and nested query parameters?
The overview does not document relation filtering or nested query parameters, and the technical evaluation lists relation filtering and bounded relation depth as unknowns. Verify in the README or source whether relation paths are allowed and how depth is limited. If you need nested filters, test for authorization gaps and query-cost exposure before relying on them.
Can I reuse the same filters outside HTTP requests, such as in console commands or jobs?
The package is positioned around changing a Request into a query builder, so its ergonomics are HTTP-centric. The evaluation warns that trait-on-Request designs couple filtering to the HTTP layer, while a standalone resolver is more portable. Check whether filter definitions can be invoked without a Request before relying on reuse in jobs, service calls, or GraphQL resolvers.
Is liqrgv/query-filter-laravel production-ready and actively maintained?
The evaluation cites roughly 10 stars, a single-maintainer signal, a 0.41 score, and pre-1.0 semantics, so community vetting and long-term maintenance are the headline risks. Check the last commit date, CI status, test coverage, release cadence, and whether a backward-compatibility policy exists. For critical endpoints, keep a fallback plan such as local filter classes or a more established package.
What should I check before rolling query filters into production?
Trial it on greenfield endpoints or behind existing controller signatures so the HTTP contract stays unchanged while filtering becomes declarative. Add tests for allowed filters, invalid filters returning 422 rather than 500, sort allow-listing, and bounded relation depth. Confirm supported Laravel and PHP versions, invalid-input behavior, and query-cost limits, and keep the integration easy to remove because this is a convention layer rather than infrastructure.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource