Skip to content

Commit ad339b9

Browse files
committed
#1930 add parent call and simplify setting the properties
1 parent 1a0c6d4 commit ad339b9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Relations/EmbedsOneOrMany.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ abstract class EmbedsOneOrMany extends Relation
4242
*/
4343
public function __construct(Builder $query, Model $parent, Model $related, string $localKey, string $foreignKey, string $relation)
4444
{
45-
$this->query = $query;
46-
$this->parent = $parent;
45+
parent::__construct($query, $parent);
46+
4747
$this->related = $related;
4848
$this->localKey = $localKey;
4949
$this->foreignKey = $foreignKey;
@@ -54,8 +54,6 @@ public function __construct(Builder $query, Model $parent, Model $related, strin
5454
if ($parentRelation) {
5555
$this->query = $parentRelation->getQuery();
5656
}
57-
58-
$this->addConstraints();
5957
}
6058

6159
/** @inheritdoc */

0 commit comments

Comments
 (0)