Skip to content

Commit 6883030

Browse files
authored
Take morph map into account (#15)
Translate FQCN into class alias from morph map
1 parent 5c7140c commit 6883030

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Morph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function queryCleanOrphan(Model $parentModel, Relation $relation, bool
107107
$method = $dryRun ? 'count' : 'delete';
108108

109109
return DB::table($childTable)
110-
->where($childFieldType, get_class($parentModel))
110+
->where($childFieldType, $parentModel->getMorphClass())
111111
->whereNotExists(function ($query) use (
112112
$parentModel,
113113
$childTable,

0 commit comments

Comments
 (0)