Skip to content

Commit 21f3f26

Browse files
authored
Replace array_merge with spread operator in HandleInertiaRequests (#1370)
1 parent bfe0c95 commit 21f3f26

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: stubs/inertia/app/Http/Middleware/HandleInertiaRequests.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public function version(Request $request): ?string
3030
*/
3131
public function share(Request $request): array
3232
{
33-
return array_merge(parent::share($request), [
34-
'ziggy' => function () use ($request) {
35-
return array_merge((new Ziggy)->toArray(), [
36-
'location' => $request->url(),
37-
]);
38-
},
39-
]);
33+
return [
34+
...parent::share($request),
35+
'ziggy' => fn () => [
36+
...(new Ziggy)->toArray(),
37+
'location' => $request->url(),
38+
],
39+
];
4040
}
4141
}

0 commit comments

Comments
 (0)