#1817·api

How to get a model returned in an internal request?

Author: f-livaCreated Jun 3, 2025Updated Aug 8, 2025

Hello everyone, I have read the documentation but I can't find an important piece of information. I need that when I call an endpoint via internal request, the object returned to me should be a model, but instead I get an array that I then have to hydrate into a model instance. However, this causes me to lose many of the properties that the original model would return, such as any already loaded relationships. How can I make it so that if I call an endpoint via internal request, I get the Eloquent model returned instead of an array with its data?