PHPackages                             swayok/laravel-antihack-tool - 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. swayok/laravel-antihack-tool

ActiveLibrary[Security](/categories/security)

swayok/laravel-antihack-tool
============================

Active anti-hack protection for Laravel

580PHP

Since Nov 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/swayok/laravel-antihack-tool)[ Packagist](https://packagist.org/packages/swayok/laravel-antihack-tool)[ RSS](/packages/swayok-laravel-antihack-tool/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

What is this?
=============

[](#what-is-this)

This is active anti-hack protection tool that will guard your project from most hack attempts that use HTTP requests. It also contains whitelist and blacklist functionality based on config files or database table contents

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

[](#installation)

Add `"swayok/laravel-antihack-tool": "master-dev"` to your `composer.json`into `require` section and run `composer update`

Activation
----------

[](#activation)

### For Laravale 5.5+

[](#for-laravale-55)

Service provider will be automatically loaded

### For Laravel 5.4-

[](#for-laravel-54-)

Add `LaravelAntihackTool\AntihackServiceProvider` to yor `app.providers` config

### Add section to your CMF section

[](#add-section-to-your-cmf-section)

Add `\LaravelAntihackTool\PeskyCmf\CmfHackAttempts\CmfHackAttemptsScaffoldConfig::class`to your cmf section's config (probably `config/admin.php`) into `'resources'` key:

```
    'resources' => [
        \LaravelAntihackTool\PeskyCmf\CmfHackAttempts\CmfHackAttemptsScaffoldConfig::class
    }

```

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

[](#configuration)

1. Run `php artisan vendor:publish --provider=LaravelAntihackTool\AntihackServiceProvider`to publish configuration file
2. If you plan to use database to store hack attempts - set `antihack.store_hack_attempts`configuration paramenter to `true` and modify `antihack.connection` and `antihack.table_name`configuration paramenters if needed. Then run `php artisan antihack:install` and confirm migration task. On production server you will need to run migration manually using `php artisan migrate` command.
3. If you're using PeskyCmf or PeskyCms - you may need to add a menu item for resource in your `menu()` method of your `AdminConfig` class (or other class that extends `CmfConfig` class). Menu item: `static::getMenuItem('hack_attempts')` or your custom one.
4. On development server you may need to set `antihack.allow_localhost_ip` to `true` in order to allow requests from `127.0.0.1` ip. By default this option is set to `true` for `local` environment and to `false` for any other environments.
5. I you use any urls that have `.php` extensions - set `antihack.allow_php_extension_in_url` to `true`.
6. Whitelists and blacklists are generated automatically and cached to your default cache provider. You may change cache key and duration configuration paramenters if you need. Also you may update cache using `php artisan antihack:blacklist` manually.
7. There are 2 error templates in this package: `'antihack::errors.406'`(hack detected) and `'antihack::errors.423'` (ip or user agent is blacklisted/banned). In Laravel 5.5+ you will need to modify your `App\Exceptions\Handler` class like this to use them:

    ```
     public function prepareResponse($request, Exception $exception) {
         if ($exception instanceof \LaravelAntihackTool\Exception\AntihackException) {
             return response()->view('antihack::errors.' . $exception->getStatusCode());
         }
         return parent::prepareResponse($request, $exception);
     }

    ```

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a631e17770f1ef26d05cbc896e14b218d186973a00a515eed2d86fbc9eb936a?d=identicon)[sway](/maintainers/sway)

---

Top Contributors

[![swayok](https://avatars.githubusercontent.com/u/629675?v=4)](https://github.com/swayok "swayok (33 commits)")

### Embed Badge

![Health badge](/badges/swayok-laravel-antihack-tool/health.svg)

```
[![Health](https://phpackages.com/badges/swayok-laravel-antihack-tool/health.svg)](https://phpackages.com/packages/swayok-laravel-antihack-tool)
```

###  Alternatives

[phpids/phpids

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application

791150.0k2](/packages/phpids-phpids)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25866.3k44](/packages/paragonie-ecc)[nicobleiler/php-passphrase

Passphrase generator with Laravel integration, inspired by Bitwarden. Uses the EFF long word list by default with support for custom wordlists.

4912.6k](/packages/nicobleiler-php-passphrase)[dwgebler/encryption

Encryption wrapper for PHP using libsodium — simple API for symmetric and asymmetric encryption, password hashing, digital signing, and message authentication.

317.5k](/packages/dwgebler-encryption)

PHPackages © 2026

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