voronoi/lock-dev-middleware

Laravel middleware to add HTTP Auth just to dev servers

dev-master 2020-06-10 20:48 UTC

This package is auto-updated.

Last update: 2024-06-11 13:58:26 UTC


README

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.

Installation

  1. composer require voronoi/lock-dev-middleware

  2. Set DEV_USERNAME and DEV_PASSWORD in your .env file.

  3. Add \Voronoi\LockDev\Middleware::class to your app/Http/Kernel.php to lock everything down.

protected $middleware = [
	\App\Http\Middleware\DevLogin::class,
	...
];

  1. Enjoy!

Tests

Be sure to run the tests with --stderr. e.g. vendor/bin/phpunit --stderr.