Skip to content

Basic authentication using master credentials for the application.

License

Notifications You must be signed in to change notification settings

emyasnikov/laravel-basic-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Basic Auth

Latest Version on Packagist MIT Licensed Total Downloads

Basic authentication using master credentials for the application.

Installation

composer require intraset/laravel-basic-auth

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="Intraset\LaravelBasicAuth\ServiceProvider"

Usage

Activate the middleware in the .env file:

BASIC_AUTH_ENABLED=true

Set the master credentials in the .env file:

BASIC_AUTH_USERNAME=admin
BASIC_AUTH_PASSWORD=secret

Change the middleware alias in the .env file:

BASIC_AUTH_ALIAS=basic.auth

Change the middleware behavior to be applied to the application globally in the .env file:

BASIC_AUTH_GLOBAL=true

Change the middleware behavior to be applied to the middleware group in the .env file:

BASIC_AUTH_GROUP=web

Middleware

The middleware can be used in the following ways:

Route::get('/', function () {
    //
})->middleware('basic.auth');

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Basic authentication using master credentials for the application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages