PHPackages                             teikun-86/anti-spoof - 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. [Security](/categories/security)
4. /
5. teikun-86/anti-spoof

ActiveLibrary[Security](/categories/security)

teikun-86/anti-spoof
====================

Laravel middleware to detect and prevent spoofed IPs, forged headers, and identity manipulation attempts.

0.1.6(11mo ago)710↓93.3%[1 issues](https://github.com/teikun-86/anti-spoof/issues)MITPHPPHP ^8.1

Since Jul 18Pushed 11mo agoCompare

[ Source](https://github.com/teikun-86/anti-spoof)[ Packagist](https://packagist.org/packages/teikun-86/anti-spoof)[ RSS](/packages/teikun-86-anti-spoof/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (8)Used By (0)

AntiSpoof — Laravel Middleware to Detect Request Spoofing
=========================================================

[](#antispoof--laravel-middleware-to-detect-request-spoofing)

[![Packagist Version](https://camo.githubusercontent.com/c985c24a51e41dc3f776a2373a3648488aed7d1e93e0935b96f2698ed23e9d7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465696b756e2d38362f616e74692d73706f6f66)](https://camo.githubusercontent.com/c985c24a51e41dc3f776a2373a3648488aed7d1e93e0935b96f2698ed23e9d7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465696b756e2d38362f616e74692d73706f6f66)[![CodeFactor](https://camo.githubusercontent.com/9fab8ac0fd02a0f1b51362336650b96b6328645954772addc32eb4d704ac58dd/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f7465696b756e2d38362f616e74692d73706f6f662f6261646765)](https://www.codefactor.io/repository/github/teikun-86/anti-spoof)

\*\*AntiSpoof\*\* is a Laravel package that protects your API against spoofed IPs, forged headers, and suspicious User-Agents. It’s plug-and-play, built with middleware + actions + events, and works beautifully with any Laravel-based API. ---

Features
--------

[](#features)

- Detect spoofed `X-Forwarded-For` headers
- Detect suspicious or blacklisted User-Agents
- Event-driven architecture (customizable responses)
- Fully configurable

---

Installation
------------

[](#installation)

```
composer require teikun-86/anti-spoof
```

Publish the Config File
-----------------------

[](#publish-the-config-file)

To customize the package settings, publish the configuration file:

```
php artisan vendor:publish --tag=anti-spoof-config
```

Configuration
-------------

[](#configuration)

The configuration file is located at `config/anti-spoof.php`. You can customize the following settings:

```
