We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 727a3e7 commit 2262235Copy full SHA for 2262235
src/Response.php
@@ -49,13 +49,10 @@ public function withViewData($key, $value = null)
49
public function toResponse($request)
50
{
51
$only = array_filter(explode(',', $request->header('X-Inertia-Only')));
52
- $props = $only ? array_only($this->props, $only) : $this->props;
53
54
- array_walk_recursive($props, function (&$prop) {
55
- if ($prop instanceof Closure) {
56
- $prop = App::call($prop);
57
- }
58
- });
+ $props = array_map(function ($prop) {
+ return $prop instanceof Closure ? App::call($prop) : $prop;
+ }, $only ? array_only($this->props, $only) : $this->props);
59
60
$page = [
61
'component' => $this->component,
0 commit comments