use array_values on relationship matches.
This commit is contained in:
@@ -98,7 +98,7 @@ class Has_Many extends Has_One_Or_Many {
|
|||||||
return $v->$foreign == $parent->get_key();
|
return $v->$foreign == $parent->get_key();
|
||||||
});
|
});
|
||||||
|
|
||||||
$parent->relationships[$relationship] = $matching;
|
$parent->relationships[$relationship] = array_values($matching);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ class Has_Many_And_Belongs_To extends Relationship {
|
|||||||
return $v->pivot->$foreign == $parent->get_key();
|
return $v->pivot->$foreign == $parent->get_key();
|
||||||
});
|
});
|
||||||
|
|
||||||
$parent->relationships[$relationship] = $matching;
|
$parent->relationships[$relationship] = array_values($matching);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user