Skip to content

Commit

Permalink
Take morph map into account (#15)
Browse files Browse the repository at this point in the history
Translate FQCN into class alias from morph map
  • Loading branch information
buddhaCode authored Sep 4, 2022
1 parent 5c7140c commit 6883030
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Morph.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function queryCleanOrphan(Model $parentModel, Relation $relation, bool
$method = $dryRun ? 'count' : 'delete';

return DB::table($childTable)
->where($childFieldType, get_class($parentModel))
->where($childFieldType, $parentModel->getMorphClass())
->whereNotExists(function ($query) use (
$parentModel,
$childTable,
Expand Down

0 comments on commit 6883030

Please sign in to comment.