Skip to content

Commit 7b9327b

Browse files
committed
Merge branch 'release2.10.6'
2 parents 3284724 + 28a8ade commit 7b9327b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Block.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Riclep\Storyblok\Traits\HasMeta;
1818
use Storyblok\ApiException;
1919

20-
class Block implements \IteratorAggregate
20+
class Block implements \IteratorAggregate, \JsonSerializable
2121
{
2222
use CssClasses;
2323
use HasChildClasses;
@@ -283,6 +283,16 @@ private function preprocess($content) {
283283
$this->_meta = array_intersect_key($content, array_flip(['_editable', '_uid', 'component']));
284284
}
285285

286+
/**
287+
* Casting Block to JSON
288+
*
289+
* @return Collection|mixed
290+
*/
291+
public function jsonSerialize()
292+
{
293+
return $this->content();
294+
}
295+
286296
/**
287297
* Let’s up loop over the fields in Blade without needing to
288298
* delve deep into the content collection

0 commit comments

Comments
 (0)