Skip to content

Commit

Permalink
Merge pull request #31 from 23G/master
Browse files Browse the repository at this point in the history
Parent with SoftDeletes bug
  • Loading branch information
staudenmeir authored Feb 18, 2019
2 parents ac44d4a + f86e54b commit 8ea498f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Relations/BelongsToThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ protected function getForeignKey(Model $model)
protected function setSoftDeletes()
{
foreach ($this->models as $model) {
if ($model === $this->parent) {
continue;
}
if ($this->hasSoftDeletes($model)) {
$this->query->whereNull($model->getQualifiedDeletedAtColumn());
}
Expand Down

0 comments on commit 8ea498f

Please sign in to comment.