Next-Level Performance: Mastering Laravel 12.34 and 12.35 New Features
Overview
just released versions 12.34 and 12.35, introducing powerful tools to manage asynchronous tasks and system resilience. These updates focus on improving the user experience by moving heavy workloads out of the request-response cycle and providing robust failover mechanisms for mission-critical services like .
Prerequisites
To follow along, you should have a solid grasp of:
- PHP 8.2 or higher
- Basic understanding of the Laravel Service Container and
- Familiarity with
config/cache.phpandconfig/queue.phpstructures
Key Libraries & Tools
- Laravel Framework: The core PHP framework receiving these updates.
- Redis: Often used as the primary driver for both caching and queuing.
- Laravel Herd: A local development environment used to demonstrate service management.
The Deferred Queue Connection
One of the most impactful additions is the deferred queue connection. Unlike the standard sync driver—which blocks the user's browser until the job finishes—the deferred driver processes the job immediately after the HTTP response is sent to the client.
// In your Controller
ProcessNewPost::dispatch($post)->onConnection('deferred');
return redirect()->route('posts.index');
By switching to the deferred connection, the user sees an immediate redirect, while the "heavy" logic runs in the background. This provides the speed of an asynchronous worker without needing to configure a separate daemon for local development.
Implementing Failover Strategies
Systems fail. now provides a native failover driver for both and . If your primary instance goes down, the system automatically falls back to your secondary store.
// config/cache.php
'stores' => [
'failover' => [
'driver' => 'failover',
'stores' => ['redis', 'database', 'array'],
],
]
Syntax Notes
- Fluent Configuration: The
failoverdriver expects a prioritized list of stores in thestoresarray. - Driver Switching: You must update your
.envfile (e.g.,CACHE_STORE=failover) to activate these strategies.
Tips & Gotchas
- Persistence: Remember that the
arraycache driver is not persistent across requests; usedatabaseas a secondary fallback if data persistence is required during outages. - Debugging: When using the
deferredconnection, useLog::info()to verify job completion since you won't see errors in the browser once the response is sent.
- 27%· products
- 18%· products
- 18%· concepts
- 9%· concepts
- 9%· products
- Other topics
- 18%

What's New in Laravel 12.34 & 12.35
WatchLaravel // 6:40
The official YouTube channel of Laravel, the clean stack for Artisans and agents. We will update you on what's new in the world of Laravel, from the framework to our products Cloud, Forge, and Nightwatch.