ralphschindler/basic-query-filter
A lightweight Laravel package for applying request-driven filters to Eloquent queries. Map query-string parameters to allowed columns and operators, keeping filtering logic out of controllers and list endpoints predictable and reusable.
Architecture fit: The package is a framework-agnostic PHP parser for a basic query-filter language. That can fit Laravel only as a narrow parsing component: accept a filter string, produce an AST or predicate representation, then map that representation through an application-owned adapter into Eloquent/Query Builder constraints. It does not appear to provide Laravel integration, validation, authorization, SQL generation, or Eloquent binding, so it cannot be treated as an end-to-end filtering solution.
Integration feasibility: Feasible only as an isolated dependency behind an internal interface. A TPM should assume the team must own grammar validation, allow-listed fields/operators, complexity limits, and safe parameterized query mapping. Because the repository is unknown, last release was 2017, and stars are low, initial integration requires source review rather than Composer-only adoption.
Technical risk: High. Primary risks are abandoned maintenance, unknown PHP 8.x/Laravel compatibility, undocumented grammar/AST stability, low community validation, and security exposure if user-supplied filters are mapped loosely to SQL. Query-language parsers can also create denial-of-service or expensive-query risks unless input length, nesting, operator count, and allowed fields are constrained. Unlicense is permissive but should still be confirmed against organizational policy.
Key questions: What exact grammar and AST does the package expose? Does it run on supported PHP versions and Laravel versions? Are there tests for malformed and adversarial input? Can the AST be mapped safely to parameterized Eloquent queries? Who owns a fork if upstream is unavailable? What filtering use cases require this parser versus a simpler allow-listed query builder? Does the license and unknown repository provenance pass legal/security review?
Stack fit: Best suited as an internal parser utility, not a public API contract or core domain dependency. Wrap it in an application service such as FilterParser and expose only an internal, versioned filter AST. Keep Laravel request validation, authorization, field allow-lists, and query mapping outside the package.
Migration path: Start with a time-boxed spike in a branch or internal package. Validate the grammar against real product filters, compare against a simpler custom parser or existing Laravel filtering package, and decide whether to adopt, fork, or replace. If adopted, vendor/fork the source and pin it explicitly rather than relying on an unmaintained upstream release.
Compatibility: Confirm Composer constraints, PHP version support, dependency footprint, and PHPUnit/test compatibility before integration. Assume no native Laravel service provider, config, facade, or Eloquent support. Build adapters for Laravel 10/11/12 as needed and add contract tests around the parser boundary so the package can be replaced later.
Sequencing: First define supported filter grammar and field/operator allow-lists. Second run a technical spike with representative and malicious inputs. Third build an internal adapter that converts the parsed output into safe query-builder constraints. Fourth add validation, complexity limits, authorization, and audit logging. Fifth release behind a feature flag to a limited cohort. Sixth monitor parse failures, slow queries, and unsupported filter patterns before expanding.
Maintenance: High ownership burden. With a 2017 release, low stars, and unknown repository, the team should expect to maintain a fork, patch compatibility issues, and add missing tests. Treat the package as team-owned source, not a supported vendor dependency.
Support: Community support is likely minimal. There is no credible SLA, roadmap, or active maintainer signal from the provided metadata. Internal documentation, grammar fixtures, and escalation ownership are required.
Scaling: Parsing itself is likely inexpensive, but the downstream query risk is significant. Scaling concerns center on expensive user-generated filters, unindexed field combinations, deep expressions, and inconsistent query plans. Enforce allow-lists, max input length, max predicate count, timeout/query budgets, and observability on generated queries.
Failure modes: Parser errors on valid user input, silent semantic drift after PHP/Laravel upgrades, unsafe SQL mapping, unsupported operators, ambiguous precedence, denial-of-service through complex filters, and abandonment of the upstream package. Each needs a fallback: clear validation errors, contract tests, parameterized queries, feature flags, and a replacement path.
Ramp-up: Low to moderate for basic parser usage; moderate to high for safe production integration. Engineers must understand the grammar, AST shape, Laravel query mapping, security constraints, and fork ownership. Budget for documentation, adversarial test cases, and a deliberate decision record before adoption.
How can I help you explore Laravel packages today?