luketowers/purifier
A Laravel wrapper around HTMLPurifier that brings clean, secure HTML sanitization to your application. It offers a Purifier facade, Blade directive, service provider, and publishable config so you can safely filter user-supplied HTML and prevent XSS with minimal setup.
<script>/<iframe>), which is a policy choice PMs should own.Consider it when:
ezyang/htmlpurifier with Laravel-style config rather than hand-wiring the library.Look elsewhere when:
mews/purifier (a more widely adopted fork), using ezyang/htmlpurifier directly, or modern alternatives like Symfony's HTML Sanitizer for non-Laravel PHP.strip_tags-level) and don't justify an extra dependency.To executives: This is a small, MIT-licensed security component that lets us safely accept user-generated content—a prerequisite for engagement features like comments, reviews, and rich profiles. It replaces the risky option of writing our own sanitizer, reducing XSS exposure and lowering the cost of security/compliance reviews. Low cost, low commitment: it's a library, not a platform.
To engineering: It's a thin Laravel service-provider wrapper around the proven HTMLPurifier library, configurable allow-lists, drop-in via config. Caveats to flag: it targets Laravel 5 and has a small community (~32 stars), so treat it as a pragmatic shortcut—confirm compatibility with our Laravel version, pin the version, and keep an exit path to mews/purifier or the upstream library if we modernize the stack. Do not roll our own sanitizer.
How can I help you explore Laravel packages today?