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) {