__toString(); } if (function_exists('enum_exists') && $attribute instanceof UnitEnum) { return $attribute instanceof BackedEnum ? $attribute->value : $attribute->name; } throw new InvalidArgumentException('Model attribute value is an object but does not have a __toString method.'); } return $attribute; } }