diff --git a/stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php b/stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php index 73266e2de..bb2c7fa02 100644 --- a/stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php +++ b/stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php @@ -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(), + ], + ]; } }