From e2f1d939eaf914f5cb24917ac44f116fb08b35f3 Mon Sep 17 00:00:00 2001 From: Christoffer Hallas Date: Wed, 16 Jul 2025 17:48:12 -0400 Subject: [PATCH] Add eventStream signature to ResponseFactory contract Adds `eventStream` to `Illuminate\Contracts\Routing\ResponseFactory` in order to add type support for this method, aligning this with the same behavior that we have for `stream` of which `eventStream` is a convenient wrapper. --- src/Illuminate/Contracts/Routing/ResponseFactory.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Illuminate/Contracts/Routing/ResponseFactory.php b/src/Illuminate/Contracts/Routing/ResponseFactory.php index 95dcf96bcf73..8df598e8e771 100644 --- a/src/Illuminate/Contracts/Routing/ResponseFactory.php +++ b/src/Illuminate/Contracts/Routing/ResponseFactory.php @@ -57,6 +57,16 @@ public function json($data = [], $status = 200, array $headers = [], $options = */ public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0); + /** + * Create a new event stream response. + * + * @param \Closure $callback + * @param array $headers + * @param \Illuminate\Http\StreamedEvent|string|null $endStreamWith + * @return \Symfony\Component\HttpFoundation\StreamedResponse + */ + public function eventStream($callback, array $headers = [], $endStreamWith = ''); + /** * Create a new streamed response instance. *