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
Api Filters Bundle

Api Filters Bundle Laravel Package

isma/api-filters-bundle

A Laravel package for clean, query-string-driven API filtering. Turn request parameters into Eloquent queries with reusable filters, sorting, and pagination—keeping controllers thin and endpoints consistent. Simple to configure, easy to extend, and built for real-world REST APIs.

View on GitHub
Deep Wiki
Context7

A Symfony bundle that resolves API query filters from HTTP requests and applies them to query builders using a strategy pattern

Frequently asked questions about Api Filters Bundle
Does isma/api-filters-bundle work with Laravel?
Not directly. The package is a Symfony bundle: it depends on symfony/http-kernel, symfony/dependency-injection, and symfony/config, and it is activated through bundle registration plus a Configuration tree, none of which Laravel provides. Composer may install it cleanly, but the wiring layer stays inert in a Laravel app. The practical route is to extract the resolver and strategy contracts and reimplement the appliers against Eloquent.
Is this a Laravel package or a Symfony bundle?
It is a Symfony bundle. The blurb describes Laravel-style usage, but the architecture is tagged-service and registry driven, which is idiomatic Symfony DI rather than Laravel service providers and contextual binding. There is no service provider, no publishable config, and no Laravel activation path. Treat any Laravel claim as conceptual portability of the pattern, not drop-in support.
How do I install isma/api-filters-bundle?
Installation in a Symfony application follows the usual pattern: require the package with Composer and register the bundle in your bundles.php or AppKernel. Configuration is then handled through the bundle's Configuration tree. In a Laravel application there is no equivalent step, so installation alone will not produce a working filter pipeline. Expect to vendor or copy the relevant classes instead.
Can the filters be applied to Eloquent instead of Doctrine?
Only after reimplementation. The operator names ilike, ieq, and inoteq map closely onto Doctrine expression helpers and PostgreSQL semantics, which strongly suggests the strategies target Doctrine's QueryBuilder methods like andWhere, setParameter, and expr. Eloquent's Builder has a different API and no equivalent expression object. You would write new strategy classes that build where clauses and bindings for Eloquent.
What do the ilike, ieq, and inoteq filter operators do?
These are case-insensitive comparison operators added in v1.3.0: ilike for pattern matching, ieq for equality, and inoteq for not-equal. They originate in PostgreSQL semantics and were added to the public query syntax, so clients can express case-insensitive filters directly in the query string. Behavior depends on the database dialect and collation, so review them carefully before exposing them on another stack.
Which Laravel versions does this package support?
None are declared, because the package targets Symfony. There is no Laravel service provider, no config file to publish, and no support matrix for framework versions. Any Laravel support you add is your own integration work, so you are responsible for testing it against your Laravel and PHP versions. Check the Composer constraints for the Symfony components it does require.
How do I port the Symfony bundle's filtering to Laravel?
Vendor the filter resolver and strategy interfaces, then rewrite the concrete appliers so they call Eloquent Builder methods instead of Doctrine expressions. Replace the Symfony tagged-service registry with bindings in a Laravel service provider, and move the bundle's Configuration tree into a config/api-filters.php file plus a request-to-filter mapping. The surface area is small, so a port is typically days of work rather than months.
Do case-insensitive operators hurt query performance on MySQL?
Yes, if you expose them without adaptation. ilike and ieq have to be emulated as LOWER(column) LIKE LOWER(?) on MySQL, which wraps the column in a function and makes the predicate non-sargable, so indexes are bypassed. inoteq is the worst case because it combines the same non-indexable pattern with a negation, which is already low-selectivity. Nothing in the release notes suggests dialect awareness was considered.
Is isma/api-filters-bundle production-ready and actively maintained?
Treat it as an actively tended reference implementation rather than a dependency. Two merged pull requests in the v1.3.0 window show the maintainer is committing, but both come from a single author and the dependent count is effectively zero. The codebase is also single-maintainer, which is a real continuity risk. Evaluate the pattern for your own implementation rather than committing to the package as-is.
What are the alternatives for query-string API filtering in Laravel?
The closest equivalent in spirit is spatie/laravel-query-builder, which maps request parameters to Eloquent queries, sorting, and pagination with reusable filter classes. You can also hand-roll query scopes and a small filter resolver, which is essentially what this bundle does minus the Symfony layer. If you only need sorting and pagination, Laravel's built-in paginator plus explicit scopes keeps the dependency count low.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections