PHPackages                             newelement/laravel-block-bots - 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. newelement/laravel-block-bots

ActiveLibrary[Security](/categories/security)

newelement/laravel-block-bots
=============================

Block bots and high traffic offenders using Redis

0.1.2(1y ago)01.7k↓33.3%PHPPHP ^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4

Since Mar 14Pushed 1y agoCompare

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

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

Laravel Block Bots
==================

[](#laravel-block-bots)

Introduction
------------

[](#introduction)

Laravel Block Bots is a package that blocks bad crawlers, people trying to scrape your website or high-usage users, but lets good and important crawlers such as GoogleBot and Bing pass-through.

Features
--------

[](#features)

- ULTRA fast, less than 1ms increase in each request.
- Verify Crawlers using reverse DNS
- Highly configurable
- Redirect users to a page when they get blocked
- Allow logged-in users to always bypass blocks

Install
-------

[](#install)

Via Composer

```
composer require newelement/laravel-block-bots
```

#### Requirement

[](#requirement)

- This package relies heavily on Redis. To use it, make sure that Redis is configured and ready. (see [Laravel Redis Configuration](https://laravel.com/docs/12.x/redis#configuration))

#### Config

[](#config)

To adjust the library, you can publish the config file to your project using:

```
php artisan vendor:publish --provider="Newelement\LaravelBlockBots\BlockBotsServiceProvider"

```

Configure variables in your .env file:

```
BLOCK_BOTS_ENABLED=true
BLOCK_BOTS_MODE=production
#options: `production` (like a charm), `never` (bypass every route), `always` (blocks every routes)
BLOCK_BOTS_USE_DEFAULT_ALLOWED_BOTS=true
BLOCK_BOTS_WHITELIST_KEY=block_bot:whitelist
BLOCK_BOTS_FAKE_BOTS_KEY=block_bot:fake_bots
BLOCK_BOTS_PENDING_BOTS_KEY=block_bot:pending_bots
BLOCK_BOTS_LOG_ENABLED=true

```

Usage
-----

[](#usage)

It's simple. Go to `Kernel.php` and add to the `$routeMiddleware` block as :

```
protected $routeMiddleware = [
        ...
        'block' => \Newelement\LaravelBlockBots\Middleware\BlockBots::class,
    ];

```

Than you can put in the desired groups. For example, let's set to the Web group:

```

 protected $middlewareGroups = [
        'web' => [
            ...
            \App\Http\Middleware\VerifyCsrfToken::class,
            'block:100,daily', // 100 requests per day.
        ],

```

Where:

- **100**: is the number of pages an IP can access every day
- **daily**: is the time period. Options: `hourly`,`daily`, `weekly`, `monthly`, `annually`

Credits
-------

[](#credits)

Original package by [Potelo](https://github.com/potelo)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance50

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

3

Last Release

395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/526bb6fc2d5e19bb0848255a036856f35890dccc4f28adbced759ca9ef2bc166?d=identicon)[newelement](/maintainers/newelement)

---

Top Contributors

[![gabrielpeixoto](https://avatars.githubusercontent.com/u/3699061?v=4)](https://github.com/gabrielpeixoto "gabrielpeixoto (25 commits)")[![andrewalkermo](https://avatars.githubusercontent.com/u/20683045?v=4)](https://github.com/andrewalkermo "andrewalkermo (17 commits)")[![jprodrigues70](https://avatars.githubusercontent.com/u/9157395?v=4)](https://github.com/jprodrigues70 "jprodrigues70 (14 commits)")[![don-10xtravel](https://avatars.githubusercontent.com/u/215572805?v=4)](https://github.com/don-10xtravel "don-10xtravel (9 commits)")[![bratao](https://avatars.githubusercontent.com/u/1090152?v=4)](https://github.com/bratao "bratao (6 commits)")[![marivaldojr](https://avatars.githubusercontent.com/u/2505142?v=4)](https://github.com/marivaldojr "marivaldojr (4 commits)")[![dungnh](https://avatars.githubusercontent.com/u/1852709?v=4)](https://github.com/dungnh "dungnh (4 commits)")[![tsekka](https://avatars.githubusercontent.com/u/43533692?v=4)](https://github.com/tsekka "tsekka (3 commits)")[![davidmuggleton](https://avatars.githubusercontent.com/u/15907082?v=4)](https://github.com/davidmuggleton "davidmuggleton (1 commits)")[![amoktar](https://avatars.githubusercontent.com/u/6639392?v=4)](https://github.com/amoktar "amoktar (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/newelement-laravel-block-bots/health.svg)

```
[![Health](https://phpackages.com/badges/newelement-laravel-block-bots/health.svg)](https://phpackages.com/packages/newelement-laravel-block-bots)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[masterro/laravel-xss-filter

Filter user input for XSS but don't touch other html

41254.5k](/packages/masterro-laravel-xss-filter)

PHPackages © 2026

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