Skip to content

Commit 2bdd1af

Browse files
committedAug 10, 2019
Fix bug with lazily evaluating props
Needs to be recursive.
1 parent cb84170 commit 2bdd1af

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/Response.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ public function toResponse($request)
5454
? array_only($this->props, $only)
5555
: $this->props;
5656

57-
$props = array_map(function ($prop) {
58-
return $prop instanceof Closure ? App::call($prop) : $prop;
59-
}, $props);
57+
array_walk_recursive($props, function (&$prop) {
58+
if ($prop instanceof Closure) {
59+
$prop = App::call($prop);
60+
}
61+
});
6062

6163
$page = [
6264
'component' => $this->component,

0 commit comments

Comments
 (0)
Please sign in to comment.