__toString(); } if ($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; } }