The Laravel team has just dropped v12.47.0, and while it might look like a minor version bump, it brings some incredibly "quality-of-life" improvements that will make your code cleaner and more resilient.
From Taylor Otwell’s mysterious "Vector things" to highly requested Blade directives, here is a deep dive into the most important changes in this week’s release.
1. The New @includeIsolated Blade Directive
One of the standout features of this release is the @includeIsolated directive.
Normally, when you @include a Blade view, it inherits all variables from the parent view. This can sometimes lead to variable "leakage" or unintended side effects.
With @includeIsolated, the sub-view is rendered in total isolation. It only has access to the variables you explicitly pass to it. This is a game-changer for building modular, reusable components without worrying about the surrounding context.
2. Simpler Locking with Cache::withoutOverlapping()
Handling race conditions just got easier. This release introduces a wrapper around Cache::lock()->block().
Instead of manually managing lock objects, you can now use:
PHP
Cache::withoutOverlapping('process-key', function () {
// This logic only runs if the lock is acquired
}, $seconds);
This keeps your controllers and jobs clean while ensuring that critical tasks don't collide.
3. Enhanced JSON API Support
For those building headless applications, Laravel continues to refine its JSON API capabilities. This update includes a fix for circular references—ensuring your API doesn’t crash when serializing complex, interconnected models—and fixes typos in the JsonApiResource trait methods.
4. "Vector Things" and Database Improvements
Taylor Otwell contributed "Vector things" to the core, signaling Laravel's continued push into supporting AI-driven features like vector embeddings and similarity searches. Additionally, the failed_jobs stub now includes proper indexes, which will significantly improve performance when querying large sets of failed background tasks.
5. Developer Experience (DX) Tweaks
- Smarter Notifications: The
Notificationclass is now macroable, allowing you to add custom methods to the notification system without hacking the core. - Enums Everywhere: You can now use Enums for session store methods and
Bus::batchconnections. - Precognition + Wildcards: Precognitive requests now support wildcards with array validations, making real-time form validation even more powerful.
- Better Error Messages: The
key:generatecommand now provides a clearer error if yourAPP_KEYis already set, preventing accidental overrides.
Summary of Notable Commits
| Feature | Description |
| @includeIsolated | New Blade directive for isolated variable scoping. |
| Cache Failed Over | Now only fires on the first failure to reduce log noise. |
| Bus::batch | Now automatically filters out falsy items. |
| Number Helpers | Improved return type hints for Number::with*() methods. |
| Tailwind Update | The internal Tailwind version has been bumped. |
Closing Thoughts
Laravel 12 continues to mature rapidly, focusing on making the framework feel more "automatic." Whether you're working with complex Blade views or high-concurrency cache locks, v12.47.0 has something to make your life easier.
How to Update:
Run composer update in your terminal to grab the latest version!