The Laravel team released version 12.44, featuring HTTP client callbacks after the response is returned, a TestResponse header assertion method, additional fluent date validation methods, and more.
Run Callbacks After Building an HTTP Response
Luke Kuzmish contributed the ability to define callbacks after building the response in Laravel's HTTP client. The callback allows you to inspect, send events, and even mutate the response via an afterResponse() callback:
return Http::acceptJson() ->withHeader('X-Shopify-Access-Token', $shopCreds->token) ->baseUrl("https://{$shopCreds->shop_domain}.myshopify.com/admin/api/2025-10/") ->afterResponse( // Report any deprecation notices that were in the header function (Response $response) use ($shopCreds) { $header = $response->header('X-Shopify-API-Deprecated-Reason'); if ($header) { event(new ShopifyDeprecationNotice($shopCreds->shop, $header); } }) ->afterResponse( // Map the response into our own custom response class fn (Response $response) => new ShopifyResponse($response->toPsrResponse()) );
See Pull Request #58088 for implementation details.
Test Response assertHeaderContains() Method
@Milad contributed a new assertion method to the TestResponse class, helping you assert the contents of an HTTP response header in tests:
$response->assertHeaderContains('X-Custom-Header', 'value');
See Pull Request #58200 for implementation details.
Add "now" Methods to Date Rule
Caleb White contributed new methods to the Date fluent validation rule for dealing with various now() conditions:
Rule::date()->andTime()->nowOrPast();Rule::date()->andTime()->nowOrFuture();Rule::date()->andTime()->future();Rule::date()->andTime()->past();
See Pull Request #58059 for implementation details.
Add Previous Locale to the LocaleUpdated Event
Matteo Palazzo contributed an update to the LocaleUpdated event that adds the $previous property and gives you access to the previous locale when listening to the LocaleUpdated event:
function (LocaleUpdated $event) { return $event->locale === 'foo' && $event->previousLocale === 'bar';}
See Pull Request #58179 for implementation details.
Release notes
You can see the complete list of new features and updates below and the diff between 12.43.0 and 12.44.0 on GitHub. The following release notes are directly from the changelog:
v12.44.0
- [12.x] Allow easier opting out of
DatabaseLockprune lottery by @cosmastech in https://github.com/laravel/framework/pull/58152 - [12.x] Specify that the query builder returns instances of
stdClassby @axlon in https://github.com/laravel/framework/pull/58150 - [12.x] feat: add now methods to Date rule by @calebdw in https://github.com/laravel/framework/pull/58059
- [12.x] Add ability to run callbacks after building an Http response by @cosmastech in https://github.com/laravel/framework/pull/58088
- Fix docblocks by @timacdonald in https://github.com/laravel/framework/pull/58157
- [12.x] Fix Password::required() missing value validation and nullable empty … by @faisuc in https://github.com/laravel/framework/pull/58158
- [12.x] Fixup Eloquent
Collection(param) docblocks by @jnoordsij in https://github.com/laravel/framework/pull/58170 - [12.x] add MigrationSkipped event by @jackbayliss in https://github.com/laravel/framework/pull/58167
- [12.x] Simplify
LazyCollectionpassthrucalls and docblocks by @jnoordsij in https://github.com/laravel/framework/pull/58180 - [12.x] Add BusBatchable tests by @miladev95 in https://github.com/laravel/framework/pull/58175
- Add previous locale to LocaleUpdated event by @OutlawPlz in https://github.com/laravel/framework/pull/58179
- [12.x] Fix inline mail embed replacement by Content-ID by @dxnter in https://github.com/laravel/framework/pull/58173
- [12.x] Fix multibyte string handling in chopStart and chopEnd by @mdariftiens in https://github.com/laravel/framework/pull/58183
- [12.x] Improve
Collectiondocblock types by @jnoordsij in https://github.com/laravel/framework/pull/58176 - [12.x] Fix unable to disable
created_atorupdated_atcolumn when attaching models by @crynobone in https://github.com/laravel/framework/pull/58164 - Remove unused variables from destructured arrays by @rolfvandekrol in https://github.com/laravel/framework/pull/58187
- [12.x] use process to trigger package uninstall event by @cosmastech in https://github.com/laravel/framework/pull/58177
- [12.x] Fix null array key deprecation in HasOneOrMany relation matching by @serhiilabs in https://github.com/laravel/framework/pull/58191
- [12.x] Fix
Password::required()andPassword::sometimes()usage as array by @crynobone in https://github.com/laravel/framework/pull/58188 - [12.x] Add TestResponse::assertHeaderContains assertion and tests by @miladev95 in https://github.com/laravel/framework/pull/58200
- [12.x] Update setup-node action to v6 by @jackbayliss in https://github.com/laravel/framework/pull/58196