From e5fe4ec5d4507cf7399cfed4edf1f8441c1bf3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilsen=20Hern=C3=A1ndez?= Date: Wed, 22 May 2024 21:04:56 -0400 Subject: [PATCH 1/2] [12.x] Adds missing streamJson() to ResponseFactory contact --- src/Illuminate/Contracts/Routing/ResponseFactory.php | 12 ++++++++++++ src/Illuminate/Routing/ResponseFactory.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Contracts/Routing/ResponseFactory.php b/src/Illuminate/Contracts/Routing/ResponseFactory.php index 0aa51d5515f0..72614eb944ec 100644 --- a/src/Illuminate/Contracts/Routing/ResponseFactory.php +++ b/src/Illuminate/Contracts/Routing/ResponseFactory.php @@ -67,6 +67,18 @@ public function jsonp($callback, $data = [], $status = 200, array $headers = [], */ public function stream($callback, $status = 200, array $headers = []); + + /** + * Create a new streamed JSON response instance. + * + * @param array $data + * @param int $status + * @param array $headers + * @param int $encodingOptions + * @return \Symfony\Component\HttpFoundation\StreamedJsonResponse + */ + public function streamJson($data, $status = 200, $headers = [], $encodingOptions = 15); + /** * Create a new streamed response instance as a file download. * diff --git a/src/Illuminate/Routing/ResponseFactory.php b/src/Illuminate/Routing/ResponseFactory.php index 0c90965c897f..03a688f9d75a 100644 --- a/src/Illuminate/Routing/ResponseFactory.php +++ b/src/Illuminate/Routing/ResponseFactory.php @@ -131,7 +131,7 @@ public function stream($callback, $status = 200, array $headers = []) } /** - * Create a new streamed response instance. + * Create a new streamed JSON response instance. * * @param array $data * @param int $status From 07a70de85a0fb2522d7792a2e0fec62fba2b7a7c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 23 May 2024 13:40:04 -0500 Subject: [PATCH 2/2] Update ResponseFactory.php --- src/Illuminate/Contracts/Routing/ResponseFactory.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Illuminate/Contracts/Routing/ResponseFactory.php b/src/Illuminate/Contracts/Routing/ResponseFactory.php index 72614eb944ec..22cbd3cb1a83 100644 --- a/src/Illuminate/Contracts/Routing/ResponseFactory.php +++ b/src/Illuminate/Contracts/Routing/ResponseFactory.php @@ -67,7 +67,6 @@ public function jsonp($callback, $data = [], $status = 200, array $headers = [], */ public function stream($callback, $status = 200, array $headers = []); - /** * Create a new streamed JSON response instance. *