Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

goodie's avatar

Is it possible to determine JsonResource in RequestHandled event?

Hello.

Currently building API versioning for my project and stuck a bit. Is it possible to determine current JsonResource for response? On RequestHandled event $event->response->getOriginalContent() always references to the eloquent model. Is it possible to get JsonResource instance or just class reference to resource used in this response?

I couldn't figure out by myself where Laravel converts JsonResource into response in their code.

0 likes
0 replies

Please or to participate in this conversation.