diff --git a/src/HasChildren.php b/src/HasChildren.php index ff651aa..a25475e 100644 --- a/src/HasChildren.php +++ b/src/HasChildren.php @@ -235,6 +235,11 @@ public function classFromAlias($aliasOrClass): string { $childTypes = $this->getChildTypes(); + // Handling Enum casting for `type` column + if ($aliasOrClass instanceof \UnitEnum) { + $aliasOrClass = $aliasOrClass->value; + } + if (isset($childTypes[$aliasOrClass])) { return $childTypes[$aliasOrClass]; }