Never Miss a Laravel Release 🚀
The Laravel team released version 12.33.0, introducing a Stringable doesntContain() method, merging (instead of replacing) HTTP client URL parameters, improved broadcast manager resolution errors, and more.
Stringable doesntContain() Method
Michael Contento contributed a doesntContain() method on Stringable to match the Str helper and provide symmetry with the existing contains() method.
$str = str('laravel-news.com'); $str->contains('laravel'); // true$str->doesntContain('laravel'); // false$str->doesntContain('NEWS'); // true$str->doesntContain('NEWS', ignoreCase: true); // false
Http Client Merge Parameters
Chris Jones proposed a mergeUrlParameters() method to Http PendingRequest because withUrlParameters replaces all parameters. Instead, Taylor Otwell updated to PR to always merge parameters instead of introducing a new method:
Http::macro('service', function () { return Http::baseUrl('https://api.example.com') ->withUrlParameters(['version' => 'v1', 'tenant' => 'acme']);}); // Before: <12.33, `version` is removed.Http::service()->withUrlParameters(['tenant' => 'beta']);// ['tenant' => 'beta'] // After: +12.33, params are merged.Http::service()->withUrlParameters(['tenant' => 'beta']);// ['version' => 'v1', 'tenant' => 'beta']
The withUrlParameters() change is non-breaking—if you need to customize URL parameters on a reusable pending request, you can solely provide any parameters you intend to override.
Improve BroadcastManager Error Messages
Mathias Grimm contributed a clearer error message when a broadcast driver fails to initialize:
// Before:// TypeError: Pusher\Pusher::__construct(): Argument #3 ($app_id) must be of type string, null given // After:// BroadcastException: Failed to create broadcaster for connection "my-connection" with error:// Pusher\Pusher::__construct(): Argument #3 ($app_id) must be of type string, null given
Release notes
You can see the complete list of new features and updates below and the diff between 12.32.0 and 12.33.0 on GitHub. The following release notes are directly from the changelog:
v12.33.0
- Fix compiling queries that use orderByRaw with expressions by @LukeTowers in https://github.com/laravel/framework/pull/57228
- [12.x] Narrow type after
Str::is*(...)check by @axlon in https://github.com/laravel/framework/pull/57230 - [12.x] Fix invalid docblock by @tm1000 in https://github.com/laravel/framework/pull/57240
- [12.x] Refactor switch to match by @amirhshokri in https://github.com/laravel/framework/pull/57236
- [12.x] Refactor switch to match by @alipowerful7 in https://github.com/laravel/framework/pull/57237
- [12.x] Fix rounded issue in exception frame component by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57239
- [12.x] Ensure calling job within a group works as expected by @jackbayliss in https://github.com/laravel/framework/pull/57224
- fix: remove duplicated word in
Str::apamethod by @balboacodes in https://github.com/laravel/framework/pull/57254 - refactor: add |null in docblock by @alipowerful7 in https://github.com/laravel/framework/pull/57253
- [12.x] Improve
php artisan config:cacheandphp artisan optimizeerror messages for non-serializable values by @mathiasgrimm in https://github.com/laravel/framework/pull/57249 - [12.x] Ensure cookie lifetime matches session lifetime in StartSession middleware by @michaelcontento in https://github.com/laravel/framework/pull/57266
- Run tests on PostgreSQL version 18 by @JurianArie in https://github.com/laravel/framework/pull/57232
- [12x.] reduce repeated inserts in tests by @cosmastech in https://github.com/laravel/framework/pull/57273
- [12.x] Fix using pushIf blade directive with complex conditions (#57264) by @hosni in https://github.com/laravel/framework/pull/57274
- [12.x] Add Stringable::doesntContain() to match API symmetry by @michaelcontento in https://github.com/laravel/framework/pull/57279
- [12.x] Improve BroadcastManager error messages when trying to get a Broadcaster by @mathiasgrimm in https://github.com/laravel/framework/pull/57275
- [12.x] HTTP Client: add mergeUrlParameters() to combine URL parameters without overwriting by @leek in https://github.com/laravel/framework/pull/57282