hryha/laravel-simple-basic-auth
Simple Basic Auth for Laravel
This package provides a middleware for Basic Auth without using a database
Installation
Install the package via Composer:
composer require hryha/laravel-simple-basic-auth
Configuration
Configure the credentials by setting SIMPLE_BASIC_AUTH_CREDENTIALS in the .env file in json format
SIMPLE_BASIC_AUTH_CREDENTIALS='{"login1": "pass1", "login2": "pass2"}'
Usage
Access is allowed to all users with the correct credentials
Route::get('/')->middleware(SimpleBasicAuth::class);
Access is allowed only to user login1
Route::get('/')->middleware(SimpleBasicAuth::using(['login1']));
Testing
Run the test:
composer test
Related Packages
lab404/laravel-impersonate
Laravel Impersonate is a plugin that allows to you to authenticate as your users...
20,848,025
2,344
kodeine/laravel-acl
Light-weight role-based permissions for Laravel 5 built in Auth system.
364,261
774