Next-Level Performance: Mastering Laravel 12.34 and 12.35 New Features

Laravel////2 min read

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.php and config/queue.php structures

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 failover driver expects a prioritized list of stores in the stores array.
  • Driver Switching: You must update your .env file (e.g., CACHE_STORE=failover) to activate these strategies.

Tips & Gotchas

  • Persistence: Remember that the array cache driver is not persistent across requests; use database as a secondary fallback if data persistence is required during outages.
  • Debugging: When using the deferred connection, use Log::info() to verify job completion since you won't see errors in the browser once the response is sent.
Topic DensityMention share of the most discussed topics · 11 mentions across 7 distinct topics
27%· products
18%· products
18%· concepts
9%· concepts
9%· products
Other topics
18%
End of Article
Source video
Next-Level Performance: Mastering Laravel 12.34 and 12.35 New Features

What's New in Laravel 12.34 & 12.35

Watch

Laravel // 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.

Who and what they mention most
2 min read0%
2 min read