Skip to content

How to get a model returned in an internal request? #1817

@f-liva

Description

@f-liva

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions