voku/html-min
HtmlMin is a fast, easy-to-use PHP library that minifies HTML5 by stripping extra whitespace, comments, and unneeded characters without breaking structure. It also sorts attributes and CSS class names for better gzip compression, making pages smaller and faster to load.
doRemoveCommentsOnly() for removing regular HTML comments without applying other minification changesdoMinifyJavaScript() (uses tedivm/jshrink)doRemoveDataAttributes() option to drop all data-* attributes (disabled by default)doRemoveOmittedHtmlTags() to cover more WHATWG optional-tag rules (html, head, body, colgroup, tbody, rt, newer p followers, and hr handling for option / optgroup)doMakeSameDomainsLinksRelative() now accepts a plain true flag; use the new fluent setLocalDomains(array) helper to configure domains separatelySplObjectStorage-based observer registration with an array-keyed map to avoid duplicatesbody starts (meta, link, noscript, script, style, template)<script type="application/ld+json"> whitespace minification preserving valid JSON<b>, <em>, <i>, <strong>, <u>) not being preserved correctly<head> and <body> fragment closing-tag omissionid attribute handling triggering a type errortext/html script-template tags leaking internal simple_html_dom placeholdersxml:lang attribute being lost and trim script-tag whitespace for PHP 7.x compatibilitypatchSimpleHtmlDomPlaceholders() as an idempotent Reflection-based method for simple_html_dom v5 compatibilityvoku/simple_html_dom dependency to ^5.0; add tedivm/jshrink ^1.8.1; require PHP >=7.1-> this is a BC, but you can simply replace this classes in your observer implementation:
---> "SimpleHtmlDom" with "SimpleHtmlDomInterface
---> "HtmlMin" with "HtmlMinInterface"
-> this is a breaking change, without any API changes
How can I help you explore Laravel packages today?