Skip to content

Commit

Permalink
use eloquent exists method
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasleitsch committed Jan 3, 2022
1 parent 7d35e92 commit dd038ab
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 dd038ab

Please sign in to comment.