mdmahbubhelal/config-basic-auth

Provides basic auth using a config file for credentials

1.0.1 2022-04-18 17:05 UTC

This package is auto-updated.

Last update: 2025-03-05 22:55:42 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',
    ]
],