PHPackages                             konsulting/laravel-blockade - 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. konsulting/laravel-blockade

ActiveLibrary[Security](/categories/security)

konsulting/laravel-blockade
===========================

A simple block for your Laravel app to prevent access without a known code, and to force to https if you wish.

1.8.0(10mo ago)1876[1 issues](https://github.com/konsulting/laravel-blockade/issues)MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Nov 10Pushed 10mo ago2 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

Blockade
========

[](#blockade)

A simple block for your [Laravel](https://laravel.com) app to prevent access without a known code, and to force to https if you wish.\*

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

[](#installation)

- Install Blockade using composer: `composer require konsulting/laravel-blockade`
- If you are using Laravel 5.5 or above, the package will make the service provider available for auto-discovery. If you are using an earlier version of Laravel, add Blockade's Service Provider to `config/app.php`

```
'providers' => [
    // Other service providers...

    Konsulting\Laravel\Blockade\BlockadeServiceProvider::class,
],
```

- Add the middleware to your `app/Http/Kernel.php`

```
protected $middlewareGroups = [
        'web' => [
            ... Other middleware
            \Konsulting\Laravel\Blockade\IsBlocked::class,
            \Konsulting\Laravel\Blockade\ForceSecure::class,
        ],
        ... Other middleware groups
    ];
```

*Only add the middleware you want to use.*

- Publish configuration and adjust for your site

```
php artisan vendor:publish --provider=Konsulting\\Laravel\\Blockade\\BlockadeServiceProvider --tag=config

```

- Optionally publish views and adjust for your site

```
php artisan vendor:publish --provider=Konsulting\\Laravel\\Blockade\\BlockadeServiceProvider --tag=views

```

Configuration Options
---------------------

[](#configuration-options)

There is a small set of configuration options. See the `blockade.php` config file for more information.

**key** - the variable name for the 'unlock code' to be used when checking is the site is blocked.

**code** - the code that allows access, it can be set using the environment variable `BLOCKADE_CODE` in the `.env` file

**multiple\_codes** - whether or not to allow multiple codes to be used (specified as a comma-delimited list). Defaults to `false`

**show\_form** - should Blockade show a form for the user to enter the code? defaults to `false`

**redirect** - optional url to redirect the user to when blocked

**until** - optional datetime for the blockade to expire

**not\_blocked** - an array of url patterns that should not be blocked

**not\_secure** - an array of url patterns that should not be forced to https

Security
--------

[](#security)

If you find any security issues, or have any concerns, please email [keoghan@klever.co.uk](keoghan@klever.co.uk), rather than using the issue tracker.

Contributing
------------

[](#contributing)

Contributions are welcome and will be fully credited. We will accept contributions by Pull Request.

Please:

- Use the PSR-2 Coding Standard
- Add tests, if you’re not sure how, please ask.
- Document changes in behaviour, including readme.md.

Testing
-------

[](#testing)

We use [PHPUnit](https://phpunit.de) and the excellent [orchestral/testbench](https://github.com/orchestral/testbench)

Run tests using PHPUnit: `vendor/bin/phpunit`

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 55.2% 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 ~243 days

Recently: every ~461 days

Total

14

Last Release

306d ago

Major Versions

0.3.1 → 1.0.02019-04-08

PHP version history (2 changes)0.1.0PHP ^5.6 | ^7.0

1.6.0PHP ^5.6 || ^7.0 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4703657?v=4)[Konsulting](/maintainers/konsulting)[@konsulting](https://github.com/konsulting)

---

Top Contributors

[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (16 commits)")[![Keoghan](https://avatars.githubusercontent.com/u/6714599?v=4)](https://github.com/Keoghan "Keoghan (11 commits)")[![jocoDomino](https://avatars.githubusercontent.com/u/26391067?v=4)](https://github.com/jocoDomino "jocoDomino (1 commits)")[![oar3](https://avatars.githubusercontent.com/u/200414935?v=4)](https://github.com/oar3 "oar3 (1 commits)")

---

Tags

blockadelaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konsulting-laravel-blockade/health.svg)

```
[![Health](https://phpackages.com/badges/konsulting-laravel-blockade/health.svg)](https://phpackages.com/packages/konsulting-laravel-blockade)
```

###  Alternatives

[soved/laravel-gdpr

GDPR compliance with ease

299127.5k2](/packages/soved-laravel-gdpr)[masterro/laravel-xss-filter

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

41254.5k](/packages/masterro-laravel-xss-filter)[enlightn/laravel-security-checker

A Laravel package to scan your dependencies for known security vulnerabilities.

51173.4k](/packages/enlightn-laravel-security-checker)[nickurt/laravel-pwned-passwords

PwnedPasswords for Laravel 11.x/12.x/13.x

187.5k](/packages/nickurt-laravel-pwned-passwords)[dgtlss/owaspadvisor

A Laravel package to help developers implement OWASP Top 10 security guidelines

327.1k](/packages/dgtlss-owaspadvisor)

PHPackages © 2026

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