PHPackages                             kaishiyoku/laravel-html-purifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. kaishiyoku/laravel-html-purifier

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

kaishiyoku/laravel-html-purifier
================================

A HTML filter using htmlpurifier with additional HTML5 rules.

2.3.0(6y ago)05.2k3[1 issues](https://github.com/Kaishiyoku/laravel-html-purifier/issues)MITPHPPHP &gt;=7.1.3

Since May 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Kaishiyoku/laravel-html-purifier)[ Packagist](https://packagist.org/packages/kaishiyoku/laravel-html-purifier)[ RSS](/packages/kaishiyoku-laravel-html-purifier/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (18)Used By (0)

[![Maintenance](https://camo.githubusercontent.com/0080c39e8991e448d139858f9038668b6078ad14a26bacb65acf2ec3bfa9d661/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032302e737667)](https://camo.githubusercontent.com/0080c39e8991e448d139858f9038668b6078ad14a26bacb65acf2ec3bfa9d661/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032302e737667)[![Packagist](https://camo.githubusercontent.com/b21022a22e04914eb39fe630a407874a8626e639ee3a1542c6db492b4962f8f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6169736869796f6b752f6c61726176656c2d68746d6c2d70757269666965722e737667)](https://camo.githubusercontent.com/b21022a22e04914eb39fe630a407874a8626e639ee3a1542c6db492b4962f8f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6169736869796f6b752f6c61726176656c2d68746d6c2d70757269666965722e737667) [![Packagist](https://camo.githubusercontent.com/5fb635d61cea7dc7a11067e00b24f816ad31303656e1fe13df2f782d1c023b7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6169736869796f6b752f6c61726176656c2d68746d6c2d70757269666965722e737667)](https://camo.githubusercontent.com/5fb635d61cea7dc7a11067e00b24f816ad31303656e1fe13df2f782d1c023b7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6169736869796f6b752f6c61726176656c2d68746d6c2d70757269666965722e737667)

A HTML filter using htmlpurifier with additional HTML5 rules.

Table of contents
=================

[](#table-of-contents)

- [General](#general)
- [Installation](#installation)
    - [Composer](#composer)
- [Usage](#usage)
- [License](#license)
- [Author](#author)

General
=======

[](#general)

This package helps purifying HTML markup from unwanted one, like script tags or similar.

It uses the [https://github.com/ezyang/htmlpurifier](ezyang/htmlpurifier) package with some added HTML5 rules.

Installation
============

[](#installation)

Composer
--------

[](#composer)

Add `"kaishiyoku/laravel-html-purifier": "1.*"` to your **composer.json**by running `composer require kaishiyoku/laravel-html-purifier`.

Update your dependencies by running `composer update`.

Usage
=====

[](#usage)

```
$dirtyHtml = 'Dirty HTMLalert('purified?');';

$purifier = new HtmlPurifier();

$purifiedHtml = $purifier->purify($dirtyHtml);

```

**Output:**

```
Dirty HTML

```

If you have any issues feel free to open a ticket.

License
=======

[](#license)

MIT ()

Author
======

[](#author)

Twitter: [@kaishiyoku](https://twitter.com/kaishiyoku)
Website: [www.andreas-wiedel.de](http://www.andreas-wiedel.de)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~28 days

Total

17

Last Release

2290d ago

Major Versions

1.1.1 → 2.0.02018-12-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7349944ba7795f1fbec27cf22625511bc8e7fdc6b55529ac87788485cca1797?d=identicon)[Kaishiyoku](/maintainers/Kaishiyoku)

---

Top Contributors

[![Kaishiyoku](https://avatars.githubusercontent.com/u/5131112?v=4)](https://github.com/Kaishiyoku "Kaishiyoku (44 commits)")

### Embed Badge

![Health badge](/badges/kaishiyoku-laravel-html-purifier/health.svg)

```
[![Health](https://phpackages.com/badges/kaishiyoku-laravel-html-purifier/health.svg)](https://phpackages.com/packages/kaishiyoku-laravel-html-purifier)
```

###  Alternatives

[illuminate/validation

The Illuminate Validation package.

18837.7M1.6k](/packages/illuminate-validation)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2422.3M6](/packages/laravel-validation-rules-credit-card)[danielebarbaro/laravel-vat-eu-validator

A simple package that validates EU VAT numbers against the central ec.europa.eu database

41401.6k](/packages/danielebarbaro-laravel-vat-eu-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
