Skip to content

Commit

Permalink
Merge pull request #50 from lukasleitsch/feature/allow-deletes-with-l…
Browse files Browse the repository at this point in the history
…azy-loading-disabled

Call relationship directly to allow deletes with lazy loading disabled
  • Loading branch information
michaeldyrynda authored Jan 5, 2022
2 parents 284388b + dd038ab commit f961920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CascadeSoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function getCascadingDeletes()
protected function getActiveCascadingDeletes()
{
return array_filter($this->getCascadingDeletes(), function ($relationship) {
return ! is_null($this->{$relationship});
return $this->{$relationship}()->exists();
});
}
}

0 comments on commit f961920

Please sign in to comment.