3
3
namespace Inertia ;
4
4
5
5
use Closure ;
6
+ use Illuminate \Support \Arr ;
7
+ use Illuminate \Support \Str ;
8
+ use Inertia \Support \Header ;
6
9
use Illuminate \Http \Request ;
7
10
use Illuminate \Http \JsonResponse ;
8
11
use Illuminate \Support \Facades \App ;
9
- use Illuminate \Support \Str ;
10
12
use GuzzleHttp \Promise \PromiseInterface ;
11
13
use Illuminate \Support \Traits \Macroable ;
12
14
use Illuminate \Contracts \Support \Arrayable ;
13
15
use Illuminate \Contracts \Support \Responsable ;
14
16
use Illuminate \Http \Resources \Json \JsonResource ;
15
17
use Illuminate \Http \Resources \Json \ResourceResponse ;
16
- use Illuminate \Support \Arr ;
17
18
use Illuminate \Support \Facades \Response as ResponseFactory ;
18
- use Inertia \Support \Header ;
19
19
20
20
class Response implements Responsable
21
21
{
@@ -40,7 +40,6 @@ public function __construct(string $component, array $props, string $rootView =
40
40
41
41
/**
42
42
* @param string|array $key
43
- * @param mixed $value
44
43
*
45
44
* @return $this
46
45
*/
@@ -57,7 +56,6 @@ public function with($key, $value = null): self
57
56
58
57
/**
59
58
* @param string|array $key
60
- * @param mixed $value
61
59
*
62
60
* @return $this
63
61
*/
@@ -111,19 +109,19 @@ public function resolveProperties(Request $request, array $props): array
111
109
{
112
110
$ isPartial = $ request ->header (Header::PARTIAL_COMPONENT ) === $ this ->component ;
113
111
114
- if (! $ isPartial ) {
112
+ if (! $ isPartial ) {
115
113
$ props = array_filter ($ this ->props , static function ($ prop ) {
116
114
return ! ($ prop instanceof LazyProp);
117
115
});
118
116
}
119
117
120
118
$ props = $ this ->resolveArrayableProperties ($ props , $ request );
121
119
122
- if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_ONLY )) {
120
+ if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_ONLY )) {
123
121
$ props = $ this ->resolveOnly ($ request , $ props );
124
122
}
125
123
126
- if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_EXCEPT )) {
124
+ if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_EXCEPT )) {
127
125
$ props = $ this ->resolveExcept ($ request , $ props );
128
126
}
129
127
@@ -168,7 +166,7 @@ public function resolveOnly(Request $request, array $props): array
168
166
169
167
$ value = [];
170
168
171
- foreach ($ only as $ key ) {
169
+ foreach ($ only as $ key ) {
172
170
Arr::set ($ value , $ key , data_get ($ props , $ key ));
173
171
}
174
172
0 commit comments