Package Data | |
---|---|
Maintainer Username: | OwenMelbz |
Maintainer Contact: | owenmelbz@gmail.com (Owen Melbourne) |
Package Create Date: | 2017-05-26 |
Package Last Update: | 2020-03-22 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:15:34 |
Package Statistics | |
---|---|
Total Downloads: | 4,933 |
Monthly Downloads: | 3 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 2 |
Total Open Issues: | 0 |
An automatic piece of middleware for Laravel 5.x, will prompt users accessing your code base (static assets are excempt) to enter a username/password before seeing your application. Very useful for things like staging environments.
Install via composer composer require owenmelbz/basic-auth-enforcement
Register the service provider - typically done inside the app.php
providers array e.g OwenMelbz\BasicAuthEnforcement\BasicAuthEnforcementServiceProvider::class
Add ENFORCE_BASIC_AUTH=true
to your application environment config e.g .env
Add your username BASIC_AUTH_USER=username
Add your password BASIC_AUTH_PASSWORD=password
Enjoy your stress free environment agnostic basic auth.
You can public the config using php artisan vendor:publish --provider="OwenMelbz\BasicAuthEnforcement\BasicAuthEnforcementServiceProvider"
which will allow you to exclude IPs from the checks as well as custom endpoints, which is useful for payment gateway ping backs etc.
Too often we've wasted time configuring password protection, with proxy systems like CloudFlare, with apache development machines and nginx production, this removes all the headache and can simply be turned off and on at a whim.