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(12mo ago)1897[1 issues](https://github.com/konsulting/laravel-blockade/issues)MITPHPPHP ^5.6 || ^7.0 || ^8.0CI failing

Since Nov 10Pushed 12mo 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 today

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

37

—

LowBetter than 81% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity17

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

360d 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

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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