mdmahbubhelal/config-basic-auth

Provides basic auth using a config file for credentials

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

pkg:composer/mdmahbubhelal/config-basic-auth

1.0.1 2022-04-18 17:05 UTC

This package is auto-updated.

Last update: 2025-10-06 00:08:10 UTC


README

Useful mostly in staging scenarios where you don't want website publicly accessible by everyone.

Default credentials are:

username: user0
password: password0
username: user1
password: password1

Installation

composer require mdmahbubhelal/config-basic-auth --dev

Configuration

you can publish config by running:

php artisan vendor:publish --provider="MdMahbubHelal\ConfigBasicAuth\ConfigBasicAuthServiceProvider" --tag="config"

that will publish basicauth.php file in config directory

Basic auth can be disabled by adding BASICAUTH_ENABLED=false in .env

You can change the username and password in the users array:

'users' => [
    [
        'username' => 'user0',
        'password' => 'password0',
    ],
    [
        'username' => 'user1',
        'password' => 'password1',
    ]
],