This package is a dead simple way to lock access to a dev website behind basic HTTP authentication. This middleware will not authenticate for local
, testing
, or production
environments.
-
composer require voronoi/lock-dev-middleware
-
Set
DEV_USERNAME
andDEV_PASSWORD
in your.env
file. -
Add
\Voronoi\LockDev\Middleware::class
to yourapp/Http/Kernel.php
to lock everything down.
protected $middleware = [
\App\Http\Middleware\DevLogin::class,
...
];
- Enjoy!
Be sure to run the tests with --stderr
. e.g. vendor/bin/phpunit --stderr
.