selectorUrl(); if ($request instanceof Request && $request->header('X-Inertia') === 'true') { return response('', 409, ['X-Inertia-Location' => url($destination)]); } if ($request instanceof Request && $request->expectsJson()) { return response()->json([ 'message' => $this->getMessage(), 'code' => 'tenant_selection_required', ], 409); } return redirect()->to($destination); } protected function selectorUrl(): string { $novaPath = '/'.trim(Nova::path(), '/'); $toolPath = trim((string) config('nova-tenancy.routes.uri', 'nova-tenancy'), '/'); return "{$novaPath}/{$toolPath}"; } }