Laravel 13.33: Tagged Memoized Cache &amp; Model Refreshes | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. What's New in Laravel 13.33: Tagged Memoized Cache, Model Refreshes, and More

   [Laravel](https://www.msaied.com/public/articles?category=laravel) 

 What's New in Laravel 13.33: Tagged Memoized Cache, Model Refreshes, and More
==============================================================================

 Laravel 13.33 ships tagged support for the memoized cache store, a #\[Refreshes\] model attribute for generated columns, nullable AsCollection casts, inplace() index migrations, and several quality-of-life improvements.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 22 Sep 2026 · Updated 23 Sep 2026 · 3 min read

ShareCopy linkCopied

 ![What's New in Laravel 13.33: Tagged Memoized Cache, Model Refreshes, and More](https://cdn.msaied.com/695/68465c4a316f52e811ca17f35812522d.png) 

  On this page +1. [Laravel 13.33 Released: Key Features and Improvements](#laravel-1333-released-key-features-and-improvements)
2. [Tagged Memoized Cache](#tagged-memoized-cache)
3. [Refresh Model Attributes After Writes](#refresh-model-attributes-after-writes)
4. [Store a Real NULL With AsCollection and AsArrayObject](#store-a-real-null-with-ascollection-and-asarrayobject)
5. [inplace() and lock() for Index Migrations](#inplace-and-lock-for-index-migrations)
6. [Other Notable Changes](#other-notable-changes)
7. [Key Takeaways](#key-takeaways)

 Laravel 13.33 Released: Key Features and Improvements
-----------------------------------------------------

The Laravel team shipped v13.33.0 on September 23, 2026, with a solid set of developer-focused additions. Here is a breakdown of the most impactful changes.

---

### Tagged Memoized Cache

Contributed by Joost de Bruijn, `Cache::memo()` now supports tagged caches via a `tags()` method. Within a single request, repeated reads for the same key hit the cache backend only once — subsequent reads are served from memory.

```php
// Two calls, one round trip to Redis
Cache::memo()->tags(['permissions'])->get("permissions:{$user->id}");
Cache::memo()->tags(['permissions'])->get("permissions:{$user->id}");

// Writes go to the tagged cache and drop the memoized copy
Cache::memo()->tags(['permissions'])->put("permissions:{$user->id}", $permissions);

// Flushing the tag also clears memoized entries
Cache::memo()->tags(['permissions'])->flush();

```

Before this change, combining tagged caches with memoization required a manual `Cache::store('array')` wrapper. See [\#61593](https://github.com/laravel/framework/pull/61593).

---

### Refresh Model Attributes After Writes

Caleb White contributed a `#[Refreshes]` PHP attribute (and a `$refreshes` property alternative) that reloads specific database columns after a model is created or updated. This is particularly useful for `virtualAs` and `storedAs` generated columns that the database computes at write time.

```php
use Illuminate\Database\Eloquent\Attributes\Refreshes;

#[Refreshes('name')]
class User extends Model
{
    //
}

$user = User::create(['first_name' => 'Taylor', 'last_name' => 'Otwell']);
$user->name; // "Taylor Otwell" — no manual refresh() call needed

```

The refresh issues one targeted query for the listed columns only, on the write connection. See [\#61523](https://github.com/laravel/framework/pull/61523).

---

### Store a Real NULL With AsCollection and AsArrayObject

Zein Ahmad added an opt-in `nullable()` mode to both casts. Without it, assigning `null` stores the JSON string `"null"`, which breaks `whereNull()` queries. With `nullable()`, the column stores a proper database `NULL`.

```php
protected function casts(): array
{
    return [
        'items'   => AsCollection::class,       // stores "null"
        'meta'    => AsCollection::nullable(),   // stores NULL
        'options' => AsArrayObject::nullable(),
    ];
}

```

See [\#61596](https://github.com/laravel/framework/pull/61596).

---

### inplace() and lock() for Index Migrations

Sander Muller added `inplace()` and `lock()` modifiers for index and foreign key operations, letting MySQL migrations request `ALGORITHM=INPLACE` and `LOCK=NONE` to avoid blocking table rebuilds.

```php
Schema::table('video_sessions', function (Blueprint $table) {
    $table->index('foo', 'foo_index')->inplace()->lock('none');
});

```

Supported methods: `index()`, `unique()`, `primary()`, `fullText()`, `spatialIndex()`, and `foreign()`. See [\#61602](https://github.com/laravel/framework/pull/61602).

---

### Other Notable Changes

- **Form Request parent attributes** — `#[StopOnFirstFailure]` and similar attributes on a base `FormRequest` class are now inherited by child requests ([\#61586](https://github.com/laravel/framework/pull/61586)).
- **Worker::$killOnTimeout** — Set to `false` to throw `TimeoutExceededException` instead of killing the worker process on job timeout ([\#61591](https://github.com/laravel/framework/pull/61591)).
- **mockArtisan() / realArtisan()** — New test helpers that cleanly separate expectation-based Artisan mocking from real command execution ([\#61588](https://github.com/laravel/framework/pull/61588)).
- **Valkey protocol support** — `valkey://` and `valkeys://` connection strings are now recognized ([\#61635](https://github.com/laravel/framework/pull/61635)).

---

Key Takeaways
-------------

- `Cache::memo()->tags([...])` eliminates redundant cache backend round trips for tagged keys within a request.
- `#[Refreshes]` keeps generated/computed columns accurate on the in-memory model after every write.
- `AsCollection::nullable()` ensures `whereNull()` works correctly on JSON cast columns.
- `inplace()` on index migrations reduces downtime risk on large MySQL tables.
- `mockArtisan()` and `realArtisan()` make Artisan testing intent explicit without toggling `$mockConsoleOutput`.

---

Source: [Laravel News — Laravel 13.33.0](https://laravel-news.com/laravel-13-33-0)

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [Laravel 13](https://www.msaied.com/public/articles?search=Laravel%2013)
- [Eloquent](https://www.msaied.com/public/articles?search=Eloquent)
- [Cache](https://www.msaied.com/public/articles?search=Cache)
- [Migrations](https://www.msaied.com/public/articles?search=Migrations)
- [Queue](https://www.msaied.com/public/articles?search=Queue)

 Frequently asked questions 
---------------------------

  What does Cache::memo()-&gt;tags() do in Laravel 13.33?It combines the memoized cache store with tagged cache support. Within a single request, the first read fetches data from the cache backend (e.g., Redis) and stores it in memory. All subsequent reads for the same tagged key are served from memory, reducing round trips. Writes and flushes propagate to the tagged cache and also invalidate the in-memory copy.

   When should I use the #\[Refreshes\] attribute on an Eloquent model?Use it when your model has virtualAs or storedAs generated columns, or any column whose value is set by the database at write time. Without #\[Refreshes\], those columns are missing or stale on the in-memory model until you call refresh() manually. The attribute reloads only the specified columns in a single query after each create or update.

   What is the difference between AsCollection::class and AsCollection::nullable() in casts?The default AsCollection::class cast serializes a null PHP value as the JSON string "null", which means whereNull() queries will not match that row. AsCollection::nullable() stores a real database NULL instead, making the column behave as expected with null-checking queries.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleLaravel Live Denmark 2026 Talks Are Now on YouTube](https://www.msaied.com/public/articles/laravel-live-denmark-2026-talks-are-now-on-youtube) [Next articleLaravel AI SDK v1.0: Classification, Approvable Tools, Agent Middleware &amp; More](https://www.msaied.com/public/articles/laravel-ai-sdk-v10-classification-approvable-tools-agent-middleware-more)  

   On this page
-------------

1. [Laravel 13.33 Released: Key Features and Improvements](#laravel-1333-released-key-features-and-improvements)
2. [Tagged Memoized Cache](#tagged-memoized-cache)
3. [Refresh Model Attributes After Writes](#refresh-model-attributes-after-writes)
4. [Store a Real NULL With AsCollection and AsArrayObject](#store-a-real-null-with-ascollection-and-asarrayobject)
5. [inplace() and lock() for Index Migrations](#inplace-and-lock-for-index-migrations)
6. [Other Notable Changes](#other-notable-changes)
7. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/743/8998fac3a41451ab3fe1588194e17a43.png) Filament · 3 min read### Securing Filament Plugins with Plumb: Automated Security Scoring for PHP Packages

5 Oct 2026 ](https://www.msaied.com/public/articles/securing-filament-plugins-with-plumb-automated-security-scoring-for-php-packages) [ ![](https://cdn.msaied.com/742/2d02018669cdeedccb5de2efb898f0ee.png) Filament · 3 min read### Filament v3.3.56 Released: File Hash Names and Livewire Upload Fix

5 Oct 2026 ](https://www.msaied.com/public/articles/filament-v3356-released-file-hash-names-and-livewire-upload-fix) [ ![](https://cdn.msaied.com/741/5b55c123ad08e4d34e1f4b99ad6a428b.png)  · 3 min read### Filament v4 Schema-Based Forms, Infolists, and the Unified Schema API

5 Oct 2026 ](https://www.msaied.com/public/articles/filament-v4-schema-based-forms-infolists-and-the-unified-schema-api-5) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
