New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

hryha/laravel-simple-basic-auth

Basic auth for Laravel
2,327 1
Install
composer require hryha/laravel-simple-basic-auth
Latest Version:2.1.0
PHP:^8.2|^8.3|^8.4
Laravel:11 · 12 · 13
License:MIT
Last Updated:Mar 18, 2026
Links: GitHub  ·  Packagist
Maintainer: vaniok010

Simple Basic Auth for Laravel

This package provides a middleware for Basic Auth without using a database

Latest Version on Packagist Total Downloads PHP Version Laravel Version Software License

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

hryha/simple-basic-auth

Basic auth for Laravel

7,737 1
merkeleon/laravel-httpauth

Helps to lock develop version with http-auth

29,373 3
masim-appcrates/laravel-authentication

My Custome Laravel Authentication

6 0
laravel/fortify

Backend controllers and scaffolding for Laravel authentication.

72,824,586 1,760
laravel/breeze

Minimal Laravel authentication scaffolding with Blade and Tailwind.

45,396,334 3,059

Version History

Version Released PHP Laravel License
2.1.0 ^8.2|^8.3|^8.4 ^11.0|^12.0|^13.0 MIT
2.0.0 ^8.2|^8.3|^8.4 ^11.0|^12.0 MIT