HTTP Query Method Support in Laravel 13.19
Laravel #Laravel #Laravel 13 #HTTP Client #Collections #Queue #SQS

HTTP Query Method Support in Laravel 13.19

3 min read Mohamed Said Mohamed Said

What's New in Laravel 13.19

Laravel 13.19.0 was released on July 8, 2026, rounding out support for the HTTP QUERY method and shipping a handful of ergonomic improvements across collections, strings, and queues.


Http::query() Client Method

The HTTP QUERY verb carries its parameters in the request body rather than the URL — useful for search-style endpoints that need structured input without polluting the query string. Laravel 13.19 adds a first-class Http::query() method that mirrors the existing post(), put(), and patch() methods:

$response = Http::query('https://api.example.com/search', [
    'filter' => ['status' => 'active'],
]);

Data is sent as JSON by default. Chaining asForm() switches to form-encoded. Existing URL query handling — withQueryParameters() and the $query argument on get() — is completely unchanged.


query() and queryJson() Testing Helpers

To complement the client addition, the testing layer gains matching helpers so you can exercise QUERY routes without reaching for call() manually:

Route::match(['QUERY'], '/search', fn () => request()->input('filter'));

$this->queryJson('/search', ['filter' => 'active'])->assertOk();

They follow the same pattern as delete() / deleteJson(), placing test data in the request body rather than the URL.


reduceInto() Collection Method

reduceInto() is a variant of reduce() designed for mutable accumulators. The callback's return value is ignored, so object accumulators require no return statement:

$stats = $orders->reduceInto(new OrderStats, function ($stats, $order) {
    $stats->total += $order->amount;
    $stats->count++;
    $stats->largest = max($stats->largest, $order->amount);
});

For array or scalar accumulators, accept the accumulator by reference:

$tagsMap = $posts->reduceInto([], function (&$map, $post) {
    $post->tags->each(fn ($tag) => $map[$tag][] = $post->title);
});

This removes the boilerplate return $accumulator that standard reduce() requires at the end of every callback.


counted() String Helper

Str::counted() and its Stringable equivalent combine pluralization and count-prepending into a single call — a shorthand for plural($count, prependCount: true):

str('order')->counted(1); // "1 order"
str('order')->counted(2); // "2 orders"

Handy for generating user-facing labels without manual string interpolation.


Queue Improvements

Two notable queue changes ship in this release:

  • Bulk SQS dispatch via SendMessageBatch — pushing multiple jobs to SQS now batches them into a single API call instead of one request per job, reducing overhead when dispatching at scale.
  • Reserved-job inspection on the queue fake — tests can now assert on jobs that have been picked up by a worker but not yet completed, closing a gap in queue test coverage.

Other Fixes

  • deletedAtColumn is now passed through to assertSoftDeleted() and assertNotSoftDeleted().
  • Mail config options can be defined without a name.
  • ComponentAttributeBag::merge() now terminates the default style value with a semicolon.
  • Additional tests for relative date where clauses and the date rule's past()/future() methods.

Key Takeaways

  • Http::query() gives you a clean API for the HTTP QUERY verb with JSON body support out of the box.
  • query() / queryJson() testing helpers keep your test suite consistent with the new client method.
  • reduceInto() eliminates the return $accumulator boilerplate when folding into mutable objects.
  • Str::counted() / Stringable::counted() simplify count-aware string generation.
  • SQS bulk dispatch via SendMessageBatch reduces API calls when pushing many jobs at once.

Source: HTTP Query Method Support in Laravel 13.19 — Laravel News

Found this useful?

Frequently Asked Questions

3 questions
Q01 What is the HTTP QUERY method and how does Laravel 13.19 support it?
The HTTP QUERY verb is similar to GET but carries its parameters in the request body rather than the URL. Laravel 13.19 adds Http::query() on the HTTP client and query()/queryJson() on the testing layer, so you can both send and test QUERY requests using the same conventions as other HTTP verbs.
Q02 How does reduceInto() differ from reduce() in Laravel collections?
With reduce(), your callback must return the accumulator on every iteration. With reduceInto(), the return value is ignored — you mutate the accumulator directly. This is cleaner when the accumulator is an object, and you can still use a reference parameter (&$map) for arrays or scalars.
Q03 Does the SQS bulk dispatch change require any code updates?
No. The switch from individual SQS API calls to SendMessageBatch is handled internally by the framework. Existing dispatch calls work without modification and will automatically benefit from the reduced number of API requests.

Continue reading

More Articles

View all