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

[5.7] Fix loadMissing() with duplicate relation names #27040

merged 1 commit into from Jan 3, 2019


None yet
3 participants
Copy link

staudenmeir commented Jan 3, 2019

loadMissing() doesn't work with duplicate relationship names:

$posts = Post::with('comments')->get();

This is caused by the structure of the internal $path array:

// before
array:2 [
  "comments" => "comments"
  "parent" => "parent"

// now
array:3 [
  0 => array:1 [
    "comments" => "comments"
  1 => array:1 [
    "parent" => "parent"
  2 => array:1 [
    "parent" => "parent"

Fixes #27039.


This comment has been minimized.

Copy link

phh commented Jan 3, 2019

Can confirm that this fixes my issue in #27039

@taylorotwell taylorotwell merged commit cec4317 into laravel:5.7 Jan 3, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed

@staudenmeir staudenmeir deleted the staudenmeir:load-missing branch Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment