From 6d072c1ef0a7ce415a238742c127d9e362f13d78 Mon Sep 17 00:00:00 2001 From: Joel Butcher Date: Wed, 15 Feb 2023 15:39:37 +0000 Subject: [PATCH] Fix share inertia data (again) --- src/Http/Middleware/ShareInertiaData.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Http/Middleware/ShareInertiaData.php b/src/Http/Middleware/ShareInertiaData.php index e57468fe..07ff304c 100644 --- a/src/Http/Middleware/ShareInertiaData.php +++ b/src/Http/Middleware/ShareInertiaData.php @@ -3,6 +3,7 @@ namespace JoelButcher\Socialstream\Http\Middleware; use Closure; +use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; @@ -15,7 +16,7 @@ class ShareInertiaData /** * Handle the incoming request. */ - public function handle(Request $request, Closure $next): Response|RedirectResponse + public function handle(Request $request, Closure $next): Response|RedirectResponse|JsonResponse { Inertia::share(array_filter([ 'socialstream' => function () use ($request) {