diff --git a/src/Illuminate/Support/Reflector.php b/src/Illuminate/Support/Reflector.php index 3f153bf3bf84..a767d5ea7073 100644 --- a/src/Illuminate/Support/Reflector.php +++ b/src/Illuminate/Support/Reflector.php @@ -148,6 +148,10 @@ public static function isParameterSubclassOf($parameter, $className) */ public static function isParameterBackedEnumWithStringBackingType($parameter) { + if (! $parameter->getType() instanceof ReflectionNamedType) { + return false; + } + $backedEnumClass = $parameter->getType()?->getName(); if (is_null($backedEnumClass)) {