- What is geekimo/php-rql used for?
- geekimo/php-rql parses RQL (Resource Query Language) query strings into a structured AST so you can validate and translate client filters, sorting, and pagination into your own query layer. It is framework-agnostic and useful for building expressive REST API query endpoints. It parses queries but does not execute database queries itself.
- How do I install geekimo/php-rql in a Laravel project?
- Install it with composer require geekimo/php-rql and confirm the package version supports your PHP runtime, especially PHP 8 if you are evaluating 3.0.0. Because the package is framework-agnostic, there is no Laravel service provider or config file to publish by default. You instantiate the parser in your own controller, request class, or service.
- Does geekimo/php-rql support Laravel 10 or Laravel 11?
- The provided context does not state Laravel version constraints; the 3.0.0 release note only mentions PHP 8 compatibility. Validate the package composer constraints and run integration tests against your Laravel version before adopting it. Do not assume Laravel 10 or 11 support from the PHP 8 note alone.
- What RQL features does php-rql support?
- It supports filters, comparisons, logical operators, sorting, and pagination, and parses expressions into a clean AST. It also provides an extensible operator and visitor system for custom behavior. You then translate the AST into your application's own query layer.
- Is geekimo/php-rql compatible with PHP 8?
- Version 3.0.0 is described as fixing PHP 8 compatibility, so it is the version to evaluate for PHP 8 environments. The context does not list exact PHP 8.x versions, so check composer.json and test on your target runtime. Treat 3.0.0 as a major upgrade and verify behavior before production use.
- What breaking changes are in php-rql 3.0.0?
- The only release note available says "Fix php 8 compatibility," but the major version number implies possible breaking changes. No upgrade guide is provided in the available context. Diff public APIs, run static analysis, and test your integration before upgrading from 2.x.
- How do I use RQL parsing in a Laravel REST API?
- Accept the raw query string in a controller or form request, parse it with php-rql, and validate the resulting AST against allowed fields and operators. Then map the AST to Eloquent or query-builder calls using parameterized values. Do not pass raw RQL directly into SQL.
- Can I add custom RQL operators or visitors with php-rql?
- Yes, the package provides an extensible operator and visitor system for custom behavior. Use it to add domain-specific operators or to traverse the AST for validation and query translation. Keep custom operators allow-listed so you do not expose unintended query capabilities.
- Is php-rql safe for production API filtering?
- The parser produces a structured AST rather than executing queries, which helps separate parsing from database access. Production safety depends on your translation layer: allow-list fields and operators, validate values, and use parameterized queries. Review the package maintenance status and test coverage before relying on it in critical paths.
- What are alternatives to geekimo/php-rql for RQL or API query parsing?
- Alternatives include implementing a small custom query-string parser, using framework-specific filter packages, or adopting another RQL parser with a different feature set. php-rql fits when you specifically want RQL syntax and an AST covering filters, sorting, and pagination. Evaluate maintenance activity, PHP and Laravel compatibility, and operator extensibility before choosing.