Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nested Relationship with includeRelationship Method #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GramParallelo
Copy link

@GramParallelo GramParallelo commented Jun 18, 2020

Hello,

First off, Thanks for the package!

In reducing query count I found that I didn't want eager-load a nested relationship. The following pseudo code hopefully explains the situation.

/// PostController
responder()->success($posts, PostTransformer::class)->with('comments.user')->response();

/// PostTransformer 
relations = ['comments' => CommentsTransformer::class']

/// CommentsTransformer
relations = ['user' => UserTransformer::class];
includeUser() { // ... do whatever, ex. grab user from cache instead of eager-load // }

Let me know, thanks!

@GramParallelo GramParallelo marked this pull request as ready for review June 18, 2020 17:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant