Skip to content

Commit 9cee86f

Browse files
committed
use array_values on relationship matches.
1 parent b8b0c08 commit 9cee86f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

laravel/database/eloquent/relationships/has_many.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function match($relationship, &$parents, $children)
9898
return $v->$foreign == $parent->get_key();
9999
});
100100

101-
$parent->relationships[$relationship] = $matching;
101+
$parent->relationships[$relationship] = array_values($matching);
102102
}
103103
}
104104

laravel/database/eloquent/relationships/has_many_and_belongs_to.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function match($relationship, &$parents, $children)
332332
return $v->pivot->$foreign == $parent->get_key();
333333
});
334334

335-
$parent->relationships[$relationship] = $matching;
335+
$parent->relationships[$relationship] = array_values($matching);
336336
}
337337
}
338338

0 commit comments

Comments
 (0)