Skip to content

Commit

Permalink
close #1956 Fixed: Recurring Invoice deleted_at issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Apr 2, 2021
1 parent 4e9645c commit 5abb4ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Traits/Relationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ public function deleteRelationships($model, $relationships)
continue;
}

$items = $model->$relationship->all();
$items = [];
$relation = $model->$relationship;

if ($items instanceof Collection) {
$items = $items->all();
if ($relation instanceof Collection) {
$items = $relation->all();
} else {
$items[] = $relation;
}

foreach ((array) $items as $item) {
Expand Down

0 comments on commit 5abb4ee

Please sign in to comment.