Skip to content

Commit 120eebd

Browse files
committed
Update partial reload headers
1 parent 2262235 commit 120eebd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Response.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ public function withViewData($key, $value = null)
4848

4949
public function toResponse($request)
5050
{
51-
$only = array_filter(explode(',', $request->header('X-Inertia-Only')));
51+
$only = array_filter(explode(',', $request->header('X-Inertia-Partial-Data')));
52+
53+
$props = ($only && $request->header('X-Inertia-Partial-Component') === $this->component)
54+
? array_only($this->props, $only)
55+
: $this->props;
5256

5357
$props = array_map(function ($prop) {
5458
return $prop instanceof Closure ? App::call($prop) : $prop;
55-
}, $only ? array_only($this->props, $only) : $this->props);
59+
}, $props);
5660

5761
$page = [
5862
'component' => $this->component,

0 commit comments

Comments
 (0)