Skip to content

Commit a7a5004

Browse files
authored
support Castable on Enum (#56977)
1 parent 0d00d04 commit a7a5004

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,10 @@ protected function isEnumCastable($key)
17881788
return false;
17891789
}
17901790

1791+
if (is_subclass_of($castType, Castable::class)) {
1792+
return false;
1793+
}
1794+
17911795
return enum_exists($castType);
17921796
}
17931797

0 commit comments

Comments
 (0)