diff --git a/src/LaravelDataServiceProvider.php b/src/LaravelDataServiceProvider.php index 77463369..d46ce15e 100644 --- a/src/LaravelDataServiceProvider.php +++ b/src/LaravelDataServiceProvider.php @@ -79,5 +79,12 @@ public function packageBooted(): void if ($enableVarDumperCaster) { (new VarDumperManager())->initialize(); } + + if (method_exists($this, 'optimizes')) { + $this->optimizes( + optimize: 'data:cache-structures', + key: 'laravel-data', + ); + } } }