detect()) { return null; } $url = str_replace('/render', '', rtrim(config('inertia.ssr.url', 'http://127.0.0.1:13714'), '/')).'/render'; try { $response = Http::post($url, $page)->throw()->json(); } catch (Exception $e) { return null; } if (is_null($response)) { return null; } return new Response( implode("\n", $response['head']), $response['body'] ); } }