Skip to content

Commit

Permalink
Update Model.php
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken authored May 10, 2021
1 parent e87b398 commit 58a85c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function cascadeSoftDelete() : void
if (isset($relationData)) {
$relationData->softDelete();
}
} elseif ($data['type'] === Relation::HAS_MANY && isset($relationData[0])) {
} elseif ($data['type'] === Relation::HAS_MANY && $relationData->count()) {
foreach ($relationData as $singleData) {
$singleData->softDelete();
}
Expand Down

0 comments on commit 58a85c7

Please sign in to comment.