PHPackages                             nerbiz/crawl-shield - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nerbiz/crawl-shield

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nerbiz/crawl-shield
===================

Prevent search engine crawlers from indexing your Laravel dev/test sites

v1.0.3(2y ago)024MITPHP

Since Jan 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nerbiz/crawl-shield)[ Packagist](https://packagist.org/packages/nerbiz/crawl-shield)[ RSS](/packages/nerbiz-crawl-shield/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

Crawl shield
============

[](#crawl-shield)

Prevent search engine crawlers from accessing your online test environments, by using a very simple password mechanism.

### ⚠️ This is not in any way intended for security!

[](#️-this-is-not-in-any-way-intended-for-security)

It will prevent crawlers from indexing your temporary testing environment and to a certain degree it also prevents unwanted visits, but don't use this for application security.

The concept
-----------

[](#the-concept)

A `?pass=...` requirement is added to your routes using middleware. This is easy to use and remember by you, but unknown to search engines.

The goal is to block all crawlers from indexing any test-environment content, in a way that always works. The mechanism is disabled on production by default.

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

[](#installation)

Install this package using Composer:

```
composer require nerbiz/crawl-shield
```

Usage
-----

[](#usage)

#### Configuration

[](#configuration)

If needed, you can add settings to your `.env` file.

The default values result in , you change that parameter and password with these:

- `CRAWL_SHIELD_PARAMETER` (default 'pass')
- `CRAWL_SHIELD_PASSWORD` (default 'abc123')

You can also disable the mechanism, or make it active in production:

- `CRAWL_SHIELD_ENABLED` (default true)
- `CRAWL_SHIELD_ENABLED_IN_PRODUCTION` (default false)

If you wish to publish the config file to your own `config/` directory, use this command:

```
php artisan vendor:publish --tag=crawl-shield
```

#### Add middleware

[](#add-middleware)

You have several options to apply the middleware in `App\Http\Kernel`, depending on how you want to shield your routes.

```
// Option 1: Shield all routes
protected $middleware = [
    // ...
    \Nerbiz\CrawlShield\Middleware\CrawlShieldMiddleware::class,
];

// Option 2: Shield only specific route group(s)
protected $middlewareGroups = [
    'web' => [
        // ...
        \Nerbiz\CrawlShield\Middleware\CrawlShieldMiddleware::class,
    ],
    // ...
];

// Option 3: Custom usage in your routes/ directory
protected $middlewareAliases = [
    // ...
    'crawl-shield' => \Nerbiz\CrawlShield\Middleware\CrawlShieldMiddleware::class,
];
```

Result
------

[](#result)

If you visit , it will return a 403 status, if it's in a development environment. You can then bypass this 403 by visiting . This is remembered in the session, so you don't need the password in every route afterwards.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

Total

4

Last Release

840d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3a41ec2ee8979a70437a20dd14b3a96eae9816f2b84cd3cb72326bcdf7bf1f8?d=identicon)[nerbiz](/maintainers/nerbiz)

---

Top Contributors

[![nerbiz](https://avatars.githubusercontent.com/u/6173907?v=4)](https://github.com/nerbiz "nerbiz (17 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/nerbiz-crawl-shield/health.svg)

```
[![Health](https://phpackages.com/badges/nerbiz-crawl-shield/health.svg)](https://phpackages.com/packages/nerbiz-crawl-shield)
```

###  Alternatives

[snapshotpl/zf-snap-geoip

MaxMind GeoIP Module for Zend Framework 2

1512.9k](/packages/snapshotpl-zf-snap-geoip)

PHPackages © 2026

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