diff --git a/composer.json b/composer.json index a476dd14..69252318 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "spatie/image": "^3.4", "spatie/laravel-ray": "^1.32", "spatie/schema-org": "^3.14", - "statamic/cms": "^5.3", + "statamic/cms": "^5.14", "whitecube/lingua": "^1.1" }, "require-dev": { diff --git a/src/View/AugmentedCascade.php b/src/View/AugmentedCascade.php index 91cc16ec..8cd61b1c 100644 --- a/src/View/AugmentedCascade.php +++ b/src/View/AugmentedCascade.php @@ -20,10 +20,20 @@ public function keys(): array ->unique()->sort()->values()->all(); } - protected function wrapValue($value, $handle) + protected function wrapDataMethodInvokable(string $method, string $handle) { return new Value( - $value, + fn () => $this->data->$method(), + $handle, + app(CascadeFieldtype::class), // Add a dummy fieldtype to enable Value objects to parse Antlers. + $this->data + ); + } + + protected function wrapDeferredValue($handle) + { + return new Value( + fn () => $this->getFromData($handle), $handle, app(CascadeFieldtype::class), // Add a dummy fieldtype to enable Value objects to parse Antlers. $this->data