Skip to content

Commit

Permalink
Replace array_merge with spread operator in HandleInertiaRequests (
Browse files Browse the repository at this point in the history
  • Loading branch information
osbre committed Aug 27, 2023
1 parent bfe0c95 commit 21f3f26
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions stubs/inertia/app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function version(Request $request): ?string
*/
public function share(Request $request): array
{
return array_merge(parent::share($request), [
'ziggy' => function () use ($request) {
return array_merge((new Ziggy)->toArray(), [
'location' => $request->url(),
]);
},
]);
return [
...parent::share($request),
'ziggy' => fn () => [
...(new Ziggy)->toArray(),
'location' => $request->url(),
],
];
}
}

0 comments on commit 21f3f26

Please sign in to comment.