src/HtmlBuilder.php
public function entities($value, bool $encoding = false): string
    {
        if ($value instanceof Htmlable) {
            return $value->toHtml();
        }

        return \htmlentities($value, ENT_QUOTES, 'UTF-8', $encoding);
    }
public function entities($value, bool $encoding = false): string
    {
        if ($value instanceof Htmlable) {
            return $value->toHtml();
        }

        return \htmlentities($value, ENT_QUOTES, 'UTF-8', $encoding);
    }
Convert an HTML string to entities.

@param  string  $value
@param  bool  $encoding

@return string