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(8mo ago)06MITPHPPHP &gt;=8.1

Since Oct 30Pushed 8mo 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 today

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

31

—

LowBetter than 66% of packages

Maintenance61

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

248d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/92842676?v=4)[rifkifathur](/maintainers/rifkifathur)[@rifkifathur](https://github.com/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

[illuminate/validation

The Illuminate Validation package.

18838.2M1.7k](/packages/illuminate-validation)[sandermuller/laravel-fluent-validation

Fluent validation rule builders for Laravel

20719.1k4](/packages/sandermuller-laravel-fluent-validation)

PHPackages © 2026

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