This PR adds the ability register an event dispatcher.
When a request has been handled successfully and an event dispatcher is registered, a RequestHandled event will be dispatched.
The event contains the initial Payload of the request and the Response.
This feature is required to create a Recorder for Laravel Pulse in the openai/laravel repository.
Todos:
[x] Find a better name for the Transportable contract
Besides the Laravel Pulse use-case, we got some people asking to instrument this library in our Sentry Laravel SDK. Is there any appetite to move forward with this PR?
This PR adds the ability register an event dispatcher.
When a request has been handled successfully and an event dispatcher is registered, a
RequestHandled
event will be dispatched. The event contains the initialPayload
of the request and theResponse
.This feature is required to create a
Recorder
for Laravel Pulse in the openai/laravel repository.Todos:
Transportable
contract