Skip to content

Commit

Permalink
[1.x] Replace array_merge with spread operator in `HandleInertiaReq…
Browse files Browse the repository at this point in the history
…uests` (#302)

* [1.x] Replace `array_merge` with spread operator in `HandleInertiaRequests`

* StyleCI
  • Loading branch information
osbre authored Aug 27, 2023
1 parent a1358dc commit 6d2c37a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public function version(Request $request): string|null
*/
public function share(Request $request): array
{
return array_merge(parent::share($request), [
return [
...parent::share($request),
'auth' => [
'user' => $request->user(),
],
'ziggy' => function () use ($request) {
return array_merge((new Ziggy)->toArray(), [
'location' => $request->url(),
]);
},
]);
'ziggy' => fn () => [
...(new Ziggy)->toArray(),
'location' => $request->url(),
],
];
}
}

0 comments on commit 6d2c37a

Please sign in to comment.