Version 20.0.0-RC41 adds native support for the new QUERY HTTP verb.
Maravel Template 20.0.0-RC11 incorporates it with the maravel-crufd-wizard:
foreach (
\MacropaySolutions\MaravelCrufdWizard\Helpers\ResourceHelper::getResourceNameToControllerFQNMap(
\Support\DbCrudMap::MODEL_FQN_TO_CONTROLLER_MAP
) as $resource => $controllerFqn
) {
$controllerFqnExploded = \explode('\\', $controllerFqn);
$controller = \end($controllerFqnExploded);
//$router->get('/' . $resource . '/{identifier}/{relation}', [
// 'as' => $resource . '.listRelated',
// 'uses' => $controller . '@listRelation',
//]); // paid version only
$router->get('/' . $resource, [
'as' => $resource . '.list',
'uses' => $controller . '@list',
]);
//$router->post('/' . $resource . '/{identifier}/{relation}/l/i/s/t', [
// 'as' => $resource . '.post_listRelated',
// 'uses' => $controller . '@listRelation',
//]); // paid version only
// or
//$router->query('/' . $resource . '/{identifier}/{relation}', [
// 'as' => $resource . '.query_listRelated',
// 'uses' => $controller . '@listRelation',
//]); // paid version only
//$router->post('/' . $resource . '/l/i/s/t', [
// 'as' => $resource . '.post_list',
// 'uses' => $controller . '@list',
//]);
// or
$router->query('/' . $resource, [
'as' => $resource . '.query_list',
'uses' => $controller . '@list',
]);
$router->post('/' . $resource, [
'as' => $resource . '.create',
'uses' => $controller . '@create',
]);
$router->put('/' . $resource . '/{identifier}', [
'as' => $resource . '.update',
'uses' => $controller . '@update',
]);
$router->get('/' . $resource . '/{identifier}', [
'as' => $resource . '.get',
'uses' => $controller . '@get',
]);
$router->delete('/' . $resource . '/{identifier}', [
'as' => $resource . '.delete',
'uses' => $controller . '@delete',
]);
$router->get('/' . $resource . '/{identifier}/{relation}/{relatedIdentifier}', [
'as' => $resource . '.getRelated',
'uses' => $controller . '@getRelated',
]);
$router->put('/' . $resource . '/{identifier}/{relation}/{relatedIdentifier}', [
'as' => $resource . '.updateRelated',
'uses' => $controller . '@updateRelated',
]);
$router->delete('/' . $resource . '/{identifier}/{relation}/{relatedIdentifier}', [
'as' => $resource . '.deleteRelated',
'uses' => $controller . '@deleteRelated',
]);
}
Gemini’s take on this:
Maravel-Framework is evolving to align with the latest web standards. With the release of Version 20.0.0-RC41 , the framework introduces native support for the QUERY HTTP verb. This update represents a significant architectural shift away from the "POST-as-GET" anti-patterns prevalent in legacy API design.
The Problem: POST /l/i/s/t
Historically, APIs requiring complex filtering or large payloads for list operations were forced to use POST endpoints (e.g., /resource/l/i/s/t). This violated HTTP semantics, as POST implies a state-changing operation, and created issues with caching, proxy behavior, and URL bookmarking.
The Solution: The HTTP QUERY Verb
The QUERY verb is designed specifically for "safe" data retrieval operations that require a body. By adopting QUERY, Maravel 20 treats data filtering as an idempotent, read-only operation that is syntactically distinct from data creation (POST).
Implementation in Maravel Template 20.0.0-RC11
The maravel-crufd-wizard has been updated to streamline route registration. The new implementation replaces the legacy POST list routes with the native query() method, resulting in cleaner, more semantic route definitions.
Key Benefits of this Architectural Shift:
- Protocol Compliance: Aligns your API with modern HTTP specifications where the QUERY verb explicitly signals a read operation that carries a body.
- Performance: By ignoring invalid filter keys rather than enforcing strict validation, the maravel-crufd-wizard ensures the fastest possible path for data retrieval.
- Clarity: Developers can distinguish between resource creation and resource searching at the routing layer, simplifying middleware and permission management.
This transition marks a milestone for Maravel-Framework, moving closer to an RPC-over-HTTP model that provides the robustness of traditional frameworks with the performance requirements of modern microservice architectures.

Top comments (0)