-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include eloquent model on included #40
Comments
Hi @tylergets ! |
So it will be something like http://yourhost.com/api/v1/tracks?included=tags |
Hey @tylergets As @dmitry-php says, in your request object for If you want to set default include paths that are used if the client does not specify any, then implement the following method on your E.g. to always include public function getIncludePaths()
{
return ['tags'];
} |
Thanks guy, this got me through my initial problem. Now question for you @lindyhopchris, setting the getIncludePaths method works when its the main resource, is it possible to include the tags models when hitting for example, a "Playlist" endpoint that returns the tracks? |
@tylergets yes, let's say you're querying Hope it helps! |
@tylergets the include path is always relative to the main resource(s). So for playlists, the include path would be |
Closing this as it's quite old now and I think the questions were answered. Feel free to open a new issue if needed. |
Hey guys, ive been struggling with these for an hour or so now. I have my searcher returning my "Tracks" model, with its tag IDs included. It's not including the tag data, such as its name, in the response. Is this possible?
This is all I am doing:
The text was updated successfully, but these errors were encountered: