Never Miss a Laravel Release 🚀
The Laravel team released version 12.34.0, introducing a failover queue driver, full-text database search improvements in Laravel Scout, deferring an HTTP client batch, and more.
Failover Queue Driver
Taylor Otwell added a failover queue driver that provides automatic failover when pushing to a queue. When the primary queue connection fails, the failover driver will push the job to the next configured connection.
'failover' => [ 'driver' => 'failover', 'connections' => [ env('QUEUE_CONNECTION', 'database'), 'sync', ],],
See Pull Request #57341 for implementation details. Also, learn how to configure the failover driver in the Queues documentation.
Full-text Improvements in Laravel Scout
Taylor Otwell added full-text improvements to Laravel Scout when using the database engine. When using Postgres, and no other ordering has been defined, it automatically uses relevancy-based order by default to match MySQL's ordering behavior.
If you are using Laravel Scout, update to the latest version using Composer to get these updates. See laravel/scout Pull Request #947 for details.
Editor Support Updates for the Local Exception Page
Multiple contributors added support for new editor links on the local exception page. You can configure the app.editor value to match a supported editor link found in ResolvesDumpSource.php.
Here's a list of new editors added in Laravel 12.34:
- Zed: Pull Request #57298
- Trae IDE: Pull Request #57300
- Windsurf IDE: Pull Request #57359
- Kiro: Pull Request #57363
- Fleet: Pull Request #57377
Closure Support for throw_if
Chris Page contributed Closure support for the throw_if exception parameter:
// By wrapping it in a closure, it'll only be evaluated when our if is truthythrow_if($apiResponse instanceof CustomResponse, fn() => new \Exception($apiResponse->message));
HTTP Batch Defer Method
Wendell Adriel originally contributed the Http Client Batch Method in Laravel 12.32. In this release, he's added a defer() method that follows the same pattern used in Concurrency.
The use case for this is if you want to batch requests after returning the response, but you want to trigger actions with the hooks:
Http::batch(fn (Batch $batch) => [ $batch->get('https://example.com/endpoint-1'), $batch->get('https://example.com/endpoint-2'),])->before(function (Batch $batch) { // The batch has been created but no requests have been initialized...})->progress(function (Batch $batch, int|string $key, Response $response) { // An individual request has completed successfully...})->then(function (Batch $batch, array $results) { // All requests completed successfully...})->catch(function (Batch $batch, int|string $key, Response|RequestException $response) { // First batch request failure detected...})->finally(function (Batch $batch, array $results) { // The batch has finished executing...})->defer();
See Pull Request #57387 for more details.
Release notes
You can see the complete list of new features and updates below and the diff between 12.33.0 and 12.34.0 on GitHub. The following release notes are directly from the changelog:
v12.34.0
- [12.x] PostgreSQL virtual columns by @tpetry in https://github.com/laravel/framework/pull/57290
- [12.x] Make Vite asset path generation extendable via inheritance by @daun in https://github.com/laravel/framework/pull/57292
- [12.x] Improve
Strdocblocks related to factories by @cosmastech in https://github.com/laravel/framework/pull/57297 - Add missing waitUntil method to FakeInvokedProcess by @yondifon in https://github.com/laravel/framework/pull/57030
- Add support for Zed Editor in ResolvesDumpSource by @miguilimzero in https://github.com/laravel/framework/pull/57298
- [12.x] Remove leftover workaround by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57306
- Fix return type order in view function signature by @MadBox-99 in https://github.com/laravel/framework/pull/57304
- Adds support for
Trae IDEin the local exception page by @sajjadhossainshohag in https://github.com/laravel/framework/pull/57300 - [12.x] Add enum support to
Schedule::useCache()by @amirhshokri in https://github.com/laravel/framework/pull/57311 - [12.x] Fix remaining PHP 8.5 null index array deprecations by @IonBazan in https://github.com/laravel/framework/pull/57308
- Regenerate session during Auth::login() by @valorin in https://github.com/laravel/framework/pull/57204
- [12.x] Formatting by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57321
- Update text color in minimal error view to ensure better accessibility by @FoksVHox in https://github.com/laravel/framework/pull/57318
- [12.x] Fix text truncation on syntax-highlighted queries by @avosalmon in https://github.com/laravel/framework/pull/57315
- [12.x] Fix email rule helper message by @erik-perri in https://github.com/laravel/framework/pull/57323
- [12.x] Do not assume
Str::uuid()returnsStringableby @cosmastech in https://github.com/laravel/framework/pull/57340 - [12.x] Add missing @throws annotation to Arr by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57336
- [12.x] Use FQCN in docblocks by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57335
- [12.x] feat: Support custom response without modifying the exception handler by @chuoke in https://github.com/laravel/framework/pull/57342
- [12.X] add support for windsurf IDE in ResolvesDumpSource by @Sajid-al-islam in https://github.com/laravel/framework/pull/57359
- [12.x] Expand single-line array into multiline by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57350
- [12.x] Added Kiro editor support in
ResolvesDumpSourceby @OmarFaruk-0x01 in https://github.com/laravel/framework/pull/57363 - [12.x] fix schedule list cli format in multibye locale by @jamessa in https://github.com/laravel/framework/pull/57367
- Prototype failover queue by @taylorotwell in https://github.com/laravel/framework/pull/57341
- Add support for Fleet editor in ResolvesDumpSource by @Rakib01 in https://github.com/laravel/framework/pull/57377
- Allow closures when calling throw_if by @chrispage1 in https://github.com/laravel/framework/pull/57349
- [12.x] Add defer method to HTTP batch by @WendellAdriel in https://github.com/laravel/framework/pull/57387
- [12.x] Supports PHPUnit 12.4 by @crynobone in https://github.com/laravel/framework/pull/57388
- [12.x] Http::batch - fix issue that non valid URL not triggering catch hook by @WendellAdriel in https://github.com/laravel/framework/pull/57386