PHPackages                             nayikidev/laravel-validate-xss - 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. nayikidev/laravel-validate-xss

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

nayikidev/laravel-validate-xss
==============================

Laravel validation rule to prevent JavaScript or dangerous HTML tags.

v1.0.1(6mo ago)05MITPHPPHP &gt;=8.1

Since Oct 30Pushed 6mo agoCompare

[ Source](https://github.com/rifkifathur/laravel-validate-xss)[ Packagist](https://packagist.org/packages/nayikidev/laravel-validate-xss)[ RSS](/packages/nayikidev-laravel-validate-xss/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel Validate XSS
====================

[](#laravel-validate-xss)

A lightweight Laravel package that provides a **custom validation rule** to prevent **Cross-Site Scripting (XSS)** attacks in user input.

---

🚀 Features
----------

[](#-features)

✅ Detects and blocks:

- `` tags
- Inline JavaScript attributes (e.g., `onclick`, `onload`, etc.)
- Dangerous input patterns like `javascript:` or ``

✅ Works with Laravel’s built-in `Validator` and FormRequest
✅ Plug-and-play: no config required

---

Minimum Requirements
--------------------

[](#minimum-requirements)

- PHP &gt;= 8.1
- Laravel 10.x
- Composer

🧩 Installation
--------------

[](#-installation)

### 1️⃣ Add to your Laravel project

[](#1️⃣-add-to-your-laravel-project)

```
composer require nayikidev/laravel-validate-xss
```

### Using the Validation Rule

[](#using-the-validation-rule)

`'field' => ['xss_protection']`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance67

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

195d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a7f41e865c77ffaa5fbea070d93e416c02568ad3bd7de63a51c3ee7ed886c30?d=identicon)[rifkifathur](/maintainers/rifkifathur)

---

Top Contributors

[![rifkifathur](https://avatars.githubusercontent.com/u/92842676?v=4)](https://github.com/rifkifathur "rifkifathur (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nayikidev-laravel-validate-xss/health.svg)

```
[![Health](https://phpackages.com/badges/nayikidev-laravel-validate-xss/health.svg)](https://phpackages.com/packages/nayikidev-laravel-validate-xss)
```

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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