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

ActiveLibrary

romanzipp/laravel-blockade
==========================

Laravel Blockade package

1.3.1(3y ago)128.0k—0%4MITPHPPHP ^7.1|^8.0CI passing

Since Sep 30Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (10)Versions (19)Used By (0)

Laravel Blockade
================

[](#laravel-blockade)

[![Latest Stable Version](https://camo.githubusercontent.com/a2c2e577c04a01177f878c2654363d1da56781eff441852a3373597b75546bd2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6d616e7a6970702f4c61726176656c2d426c6f636b6164652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/laravel-blockade)[![Total Downloads](https://camo.githubusercontent.com/c7536212276571465f6ff00a09998d64cc997b5ddedb0c0e6c2d16f7437885e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6d616e7a6970702f4c61726176656c2d426c6f636b6164652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/laravel-blockade)[![License](https://camo.githubusercontent.com/eb7d9e69f24b85d1c83bcdedf522543b0974fabecb5fa8b7937f17eb059c60b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f6d616e7a6970702f4c61726176656c2d426c6f636b6164652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/laravel-blockade)[![GitHub Build Status](https://camo.githubusercontent.com/3f9b1d68a799f3f04998d09370e971a033d751bae14a6e2a391d9d69bc7384ca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6d616e7a6970702f4c61726176656c2d426c6f636b6164652f74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/romanzipp/Laravel-Blockade/actions)

A simple but highly customizable package for preventing access to private or WIP Laravel projects.

[![](https://raw.githubusercontent.com/romanzipp/Laravel-Blockade/master/preview.png)](https://raw.githubusercontent.com/romanzipp/Laravel-Blockade/master/preview.png)

Features
--------

[](#features)

- Convenient access control for private projects or pages
- Simple, beautiful and fully customizable error page
- Replaceable authentication process &amp; token storage

#### Why just not use the Laravel Maintenance Mode?

[](#why-just-not-use-the-laravel-maintenance-mode)

Blockade offers a simple way to share access to development or staging environments only by typing in a password. The authenticating user will return the intended URL after a successful login. The built in [Laravel Maintenance Mode](https://laravel.com/docs/8.x/configuration#maintenance-mode) uses a different approach by denying access in deployment or maintenance procedures.

#### Do we need yet another access control package?

[](#do-we-need-yet-another-access-control-package)

Yes! From my experience, other maintenance mode packages (and similar) only rely on one authentication method which is either cookie or session based. When working on many projects with different tech stacks, some drivers like session storage in API-only projects are simply not available. Blockade is meant to solve this issue by combining several auth mechanisms in one package.

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

[](#installation)

```
composer require romanzipp/laravel-blockade

```

Configuration
-------------

[](#configuration)

Copy configuration &amp; assets files to project folder:

```
php artisan blockade:install

```

You can also publish views (`--views`) and language files (`--lang`) to further customize the Blockade template.

Make use of the [`--update`](#assets) parameter if you are seeing an error message at the bottom.

Usage
-----

[](#usage)

To enable Blockade, simply

1. Set the environment variables `BLOCKADE_ENABLED=true` &amp; `BLOCKADE_PASSWORD=`
2. Register the [`BlockadeMiddleware`](./src/Http/Middleware/BlockadeMiddleware.php) class in your middleware stack.

```
namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;
use romanzipp\Blockade\Http\Middleware\BlockadeMiddleware;

class Kernel extends HttpKernel
{
    // Globally for all routes

    protected $middleware = [
        // ...
        BlockadeMiddleware::class,
    ];

    // In a single middleware group

    protected $middlewareGroups = [
        'web' => [
            // ...
            BlockadeMiddleware::class,
        ]
    ];

    // As named middleware, applied in your routes file

    protected $routeMiddleware = [
        // ...
        'blockade' => BlockadeMiddleware::class,
    ];
}
```

The package defaults to the provided view for **password prompt** and stores the authentication hash in a **cookie**.

To reset previous granted access, just change the `BLOCKADE_PASSWORD` entry. All issued access tokens will be invalid on the next page request.

### Handlers

[](#handlers)

Handlers are responsible for validating authentication requests and sending successful or failed responses. You can set the active handler in [`blockade.handler`](./config/blockade.php#L28) and customize each handler individually via the [`blockade.handlers.*`](./config/blockade.php#L65) config entries.

HandlerDescriptionClass**Form** (default)The password is provided by a form[romanzipp\\Blockade\\Handlers\\FormHandler](./src/Handlers/FormHandler.php)Query ParameterThe password is attached as query parameter[romanzipp\\Blockade\\Handlers\\QueryParameterHandler](./src/Handlers/QueryParameterHandler.php)### Stores

[](#stores)

Stores are storing (how surprising) the authentication state for later requests. You can set the active store in [`blockade.store`](./config/blockade.php#L37) and customize each store individually via the [`blockade.stores.*`](./config/blockade.php#L80) config entries.

StoreDescriptionClass**Cookies** (default)The password hash will be stored as browser cookie[romanzipp\\Blockade\\Stores\\CookieStore](./src/Stores/CookieStore.php)SessionThe password hash will be stored in the active session[romanzipp\\Blockade\\Stores\\SessionStore](./src/Stores/SessionStore.php)**Important**: If you are using the `SessionStore` make sure the `BlockadeMiddleware` is appended **after** the `Illuminate\Session\Middleware\StartSession` middleware.

Extending
---------

[](#extending)

You can create your own authentication process by simply implementing the

- [`romanzipp\Blockade\Handlers\Contracts\HandlerContract`](./src/Handlers/Contracts/HandlerContract.php) interface for handlers and
- [`romanzipp\Blockade\Stores\Contracts\StoreContract`](./src/Stores/Contracts/StoreContract.php) interface for stores.

Assets
------

[](#assets)

It is recommended to publish the provided css files via the [`vendor:publish`](#configuration) command listed at the top. If the bundled asset file is not available we will use a fallback from [unkpg.com](https://unpkg.com) and display an error notice in the footer section.

Use the `--update` argument to update the published assets.

```
php artisan blockade:install --update

```

Disclamer
---------

[](#disclamer)

#### This is no cryptographically secure authentication

[](#this-is-no-cryptographically-secure-authentication)

The package stores the authentication token as SHA 256 hash of the configured password.

Testing
-------

[](#testing)

```
./vendor/bin/phpunit

```

Build Frontend
--------------

[](#build-frontend)

### Development

[](#development)

```
yarn dev

```

### Production

[](#production)

```
yarn prod

```

Credits
-------

[](#credits)

Special thanks to [Katerina Limpitsouni](https://twitter.com/ninaLimpi) for the awesome [unDraw](https://undraw.co) SVG illustrations!

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~139 days

Total

18

Last Release

1180d ago

Major Versions

0.0.9 → 1.0.02020-10-18

PHP version history (2 changes)0.0.1PHP ^7.1

1.1.1PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/309ea408cc915d1d37b370796df57a24ec31f0b65da69f69c650c8983f9c33a6?d=identicon)[romanzipp](/maintainers/romanzipp)

---

Top Contributors

[![romanzipp](https://avatars.githubusercontent.com/u/11266773?v=4)](https://github.com/romanzipp "romanzipp (118 commits)")

---

Tags

developmentlaravelpasswordphpphp7showcaseunder-construction

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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