PHPackages                             hryha/laravel-simple-basic-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. hryha/laravel-simple-basic-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

hryha/laravel-simple-basic-auth
===============================

Basic auth for Laravel

2.1.0(3mo ago)11.7k↑17.9%MITPHPPHP ^8.2|^8.3|^8.4

Since Mar 20Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/vaniok010/laravel-simple-basic-auth)[ Packagist](https://packagist.org/packages/hryha/laravel-simple-basic-auth)[ Docs](https://github.com/vaniok010/laravel-simple-basic-auth)[ RSS](/packages/hryha-laravel-simple-basic-auth/feed)WikiDiscussions 2.x Synced 2d ago

READMEChangelog (2)Dependencies (10)Versions (4)Used By (0)

Simple Basic Auth for Laravel
=============================

[](#simple-basic-auth-for-laravel)

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/d8b6d61468b3056af282964dedb28e8f9e1492a6270c7ca47a40e66c4f228bf2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68727968612f6c61726176656c2d73696d706c652d62617369632d617574682e737667)](https://packagist.org/packages/hryha/laravel-simple-basic-auth)[![Total Downloads](https://camo.githubusercontent.com/4d9eb505b0cc3efcb9939d95e407a67c782306bdb794db773a14ee640830490a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68727968612f6c61726176656c2d73696d706c652d62617369632d617574682e737667)](https://packagist.org/packages/hryha/laravel-simple-basic-auth)[![PHP Version](https://camo.githubusercontent.com/187240af044d09d5b14a1d9d9ebdf3f7a993e4c7bc09bdb46b4ba661a891bf5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c7565)](https://www.php.net/)[![Laravel Version](https://camo.githubusercontent.com/8e59528e3bffc0ff163d1ff38615457708a9335e49ff03e0e8e3046b6a65791d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31312532422d627269676874677265656e)](https://laravel.com/)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require hryha/laravel-simple-basic-auth
```

Configuration
-------------

[](#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
-----

[](#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
-------

[](#testing)

Run the test:

```
composer test
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance80

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~121 days

Total

4

Last Release

108d ago

Major Versions

2.0.0 → 3.x-dev2025-03-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/5106a78f875ddeafb9a6a976d4b4cd19e7570ca689b3450e37f88b6c8fde2a73?d=identicon)[vaniok010](/maintainers/vaniok010)

---

Top Contributors

[![vaniok010](https://avatars.githubusercontent.com/u/6134702?v=4)](https://github.com/vaniok010 "vaniok010 (3 commits)")

---

Tags

laravelauthbasic authlaravel basic authsimple basic auth

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/hryha-laravel-simple-basic-auth/health.svg)

```
[![Health](https://phpackages.com/badges/hryha-laravel-simple-basic-auth/health.svg)](https://phpackages.com/packages/hryha-laravel-simple-basic-auth)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
