Skip to content

Commit 92ee8b1

Browse files
committed
apply suggestions from PR comments
1 parent b4d3378 commit 92ee8b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Response.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
namespace Inertia;
44

55
use Closure;
6+
use Illuminate\Support\Arr;
67
use Illuminate\Http\JsonResponse;
78
use Illuminate\Support\Facades\App;
89
use Illuminate\Contracts\Support\Arrayable;
910
use Illuminate\Contracts\Support\Responsable;
10-
use Illuminate\Support\Facades\Response as ResponseFacade;
11+
use Illuminate\Support\Facades\Response as ResponseFactory;
1112

1213
class Response implements Responsable
1314
{
@@ -52,7 +53,7 @@ public function toResponse($request)
5253
$only = array_filter(explode(',', $request->header('X-Inertia-Partial-Data')));
5354

5455
$props = ($only && $request->header('X-Inertia-Partial-Component') === $this->component)
55-
? array_only($this->props, $only)
56+
? Arr::only($this->props, $only)
5657
: $this->props;
5758

5859
array_walk_recursive($props, function (&$prop) {
@@ -75,6 +76,6 @@ public function toResponse($request)
7576
]);
7677
}
7778

78-
return ResponseFacade::view($this->rootView, $this->viewData + ['page' => $page]);
79+
return ResponseFactory::view($this->rootView, $this->viewData + ['page' => $page]);
7980
}
8081
}

0 commit comments

Comments
 (0)