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)03.0k↑256.4%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 yesterday

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 75% of packages

Maintenance43

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity47

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

450d ago

### Community

Maintainers

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

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[lion/bundle

Lion-framework configuration and initialization package

122.3k4](/packages/lion-bundle)

PHPackages © 2026

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