Skip to content
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

Fix corrupted data in 'allowedIncludes' #118

Merged
merged 4 commits into from Oct 29, 2018
Merged

Fix corrupted data in 'allowedIncludes' #118

merged 4 commits into from Oct 29, 2018

Conversation

rainerkent
Copy link
Contributor

Fixes issue #112

@@ -24,6 +24,11 @@ public function setUp()
$model
->relatedModels()->create(['name' => 'Test'])
->nestedRelatedModels()->create(['name' => 'Test']);

$model->relatedThroughPivotModels()->create([
'id' => $model->id + 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@AlexVanderbist
Copy link
Member

Looks good, thanks for the PR!

@rusowyler
Copy link

Hi, this solution seems to break the morph eager queries. As it was before it worked correctly for morph relations!

May be some like this could work:

return [$fullRelationName => function ($query) use ($fields) {
    if(!($query instanceOf MorphTo)) {
        $query->select($this->prependFieldsWithTableName($fields, $query->getModel()->getTable()));
    }
}];

Or may be I got it all wrong! :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants