Laravel Updates

Laravel v12.47.0 Released: Supercharge Your Blade Templates and Cache Workflow! ๐Ÿš€

Laravel v12.47.0 is here! From the new @includeIsolated Blade directive to smarter cache locking and significant JSON API improvements, we break down the latest features and fixes you need to know for your next build.

· 3 mins read
Summarize and analyze this article with:
Share this

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 Notification class 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::batch connections.
  • Precognition + Wildcards: Precognitive requests now support wildcards with array validations, making real-time form validation even more powerful.
  • Better Error Messages: The key:generate command now provides a clearer error if your APP_KEY is already set, preventing accidental overrides.

Summary of Notable Commits

FeatureDescription
@includeIsolatedNew Blade directive for isolated variable scoping.
Cache Failed OverNow only fires on the first failure to reduce log noise.
Bus::batchNow automatically filters out falsy items.
Number HelpersImproved return type hints for Number::with*() methods.
Tailwind UpdateThe 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!

Read next

What Changed in Laravel 13 That Most Developers Are Still Ignoring

Laravel 13 shipped with zero breaking changes, which means most developers upgraded and moved on. This covers the features that should actually change how you write code.

ยท 7 mins read