diff --git a/src/collections/src/Traits/EnumeratesValues.php b/src/collections/src/Traits/EnumeratesValues.php index 2e7031f56..70bb96770 100644 --- a/src/collections/src/Traits/EnumeratesValues.php +++ b/src/collections/src/Traits/EnumeratesValues.php @@ -14,6 +14,7 @@ use Hypervel\Support\Collection; use Hypervel\Support\Enumerable; use Hypervel\Support\HigherOrderCollectionProxy; +use Hypervel\Database\Eloquent\Casts\Json; use JsonException; use JsonSerializable; use Stringable; @@ -965,7 +966,7 @@ public function jsonSerialize(): array */ public function toJson(int $options = 0): string { - return json_encode($this->jsonSerialize(), $options | JSON_THROW_ON_ERROR); + return Json::encode($this->jsonSerialize(), $options | JSON_THROW_ON_ERROR); } /**