Skip to content

Commit 7112fd8

Browse files
committed
add __toString() to make laravel 4 compatible
1 parent 1ff2e86 commit 7112fd8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/ViewObject.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ public function offsetGet($offset)
8686
return isset($this->data[$offset]) ? $this->data[$offset] : null;
8787
}
8888

89+
public function __toString()
90+
{
91+
return json_encode($this->data);
92+
}
93+
8994
public static function getFactory()
9095
{
9196
if (property_exists(get_called_class(), 'factory')) {

0 commit comments

Comments
 (0)