diff --git a/src/Relations/BelongsToManySoft.php b/src/Relations/BelongsToManySoft.php index 89513e0..796ec52 100644 --- a/src/Relations/BelongsToManySoft.php +++ b/src/Relations/BelongsToManySoft.php @@ -122,14 +122,7 @@ protected function performJoin($query = null) { $query = $query ?: $this->query; - // We need to join to the intermediate table on the related model's primary - // key column with the intermediate table's foreign key for the related - // model instance. Then we can set the "where" for the parent models. - $baseTable = $this->related->getTable(); - - $key = $baseTable.'.'.$this->relatedKey; - - $query->join($this->table, $key, '=', $this->getQualifiedRelatedPivotKeyName()); + parent::performJoin($query); $query->when($this->withSoftDeletes, function (Builder $query) { $query->whereNull($this->getQualifiedDeletedAtColumnName()); @@ -137,4 +130,4 @@ protected function performJoin($query = null) return $this; } -} \ No newline at end of file +}