dingo / dingo/api

How to get a model returned in an internal request?

Open
#1,817 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.