- Does metaclass-nl/filter-bundle work with Laravel and Eloquent?
- No. Despite some listing copy that mentions Eloquent models, the package is shipped as a Symfony bundle (hence the -bundle suffix) and is built around Doctrine ORM queries plus the Symfony Request object. Laravel uses service providers and the Eloquent query builder, so there is no supported integration path. Making it work would mean bridging HttpFoundation semantics and replacing the Doctrine expression compiler with Eloquent, which is effectively a fork rather than an install.
- What is the best Laravel alternative for query-string filtering?
- For Eloquent, use spatie/laravel-query-builder: it has high dependent counts, active maintenance, and maps request parameters onto query scopes and relationships. It covers search, sorting, includes, and custom filters without carrying a Doctrine dependency. Filtering needs that outgrow it are usually cheaper to express as explicit query scopes than to port a Symfony filter grammar.
- How do I install and register MetaClass FilterBundle in a Symfony application?
- Install it with Composer using the package name metaclass-nl/filter-bundle, then register the bundle in config/bundles.php if your Symfony Flex recipe does not do it automatically. You define filters once on your entity properties and the bundle maps matching request parameters onto DQL. Adoption on Symfony is typically a short integration rather than a multi-week project.
- Which PHP, Symfony and API Platform versions does FilterBundle support?
- The package overview does not publish a support matrix, so confirm the tested PHP range and Symfony versions with the maintainer or the CI configuration before planning. API Platform matters too: filter APIs changed materially between v3 and v4, so confirm which major is targeted. Pin an exact version and commit your lockfile rather than relying on a caret range.
- How do I define a filter on an entity property?
- You declare filters once on your entity properties using annotations or PHP attributes, choosing a filter type for each one. The bundle then reads matching query parameters from the request and translates them into DQL automatically. This removes the repetitive query-building code you would otherwise duplicate across controllers and repositories.
- What filter types are built in, and can I add my own?
- The bundle ships with comparison, range, and text filter types, which cover most list and search endpoints. Filter types are extensible, so you can implement custom logic for domain-specific comparisons. Review your custom types for query-plan impact, since deeply nested filter trees are where N+1 or full-scan problems tend to appear.
- Is metaclass-nl/filter-bundle safe to depend on in production?
- Treat it as a calculated risk. Adoption signals are thin, with roughly 50 stars and zero dependents, single-vendor provenance, and a likely bus factor of one, so breaking changes may not be caught by anyone but the maintainer. MIT licensing gives you a genuine escape hatch in the form of a vendored fork, but owning a filter-expression compiler is ongoing work. It is reasonable as an accelerator on a Symfony project you control, and risky as a load-bearing dependency.
- Does FilterBundle replace API Platform's built-in SearchFilter and other filters?
- That is not stated in the overview and should be verified in a short spike before committing. The bundle exists to add richer filter logic than API Platform's SearchFilter and FilterInterface primitives provide, so the realistic answer is that it extends rather than replaces them. Confirm composition behaviour explicitly if your endpoints already expose built-in filters.
- Is the filter grammar a stable public API, and how should I test it?
- There is no documented, guaranteed-stable filter grammar published with the overview, so treat the query-string syntax as something to verify rather than assume. Write integration tests against your own endpoints for each filter type and nesting level you expose. Define your own FilterCriteria value object and translate to the bundle's input at the boundary so the dependency stays swappable.
- Does FilterBundle only support Doctrine ORM, and is Laravel support on the roadmap?
- The overview describes Doctrine ORM and Symfony Request integration, so assume Doctrine coupling until the maintainer confirms whether the parser is backend-agnostic across ORM, ODM, or Elastic. There is no published Laravel or Eloquent roadmap. If Eloquent support matters to you, ask whether a pull request would be accepted, but do not sequence the package into a Laravel delivery plan.