diff --git a/src/Events/ResponseCreated.php b/src/Events/ResponseCreated.php index ff78d44860..7df4e2eed2 100644 --- a/src/Events/ResponseCreated.php +++ b/src/Events/ResponseCreated.php @@ -11,11 +11,14 @@ class ResponseCreated extends Event */ public $response; + public $data; + /** * @param Response $response */ - public function __construct(Response $response) + public function __construct(Response $response, $data) { $this->response = $response; + $this->data = $data; } } diff --git a/src/Http/Responses/DataResponse.php b/src/Http/Responses/DataResponse.php index e4a590686c..6c2103fa3b 100644 --- a/src/Http/Responses/DataResponse.php +++ b/src/Http/Responses/DataResponse.php @@ -45,7 +45,7 @@ public function toResponse($request) ->make($this->contents()) ->withHeaders($this->headers); - ResponseCreated::dispatch($response); + ResponseCreated::dispatch($response, $this->data); return $response; }