PHPackages                             voyager-inc/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. voyager-inc/basic-auth

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

voyager-inc/basic-auth
======================

Basic auth

010PHP

Since May 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/phutd-voyager/basic-auth)[ Packagist](https://packagist.org/packages/voyager-inc/basic-auth)[ RSS](/packages/voyager-inc-basic-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simple block blacklist and whitelist IP
=======================================

[](#simple-block-blacklist-and-whitelist-ip)

[`PHP v8.2`](https://php.net)

[`Laravel v11.x`](https://github.com/laravel/laravel)

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

[](#installation)

```
composer require voyager-inc/basic-auth
```

- Publish provider

```
php artisan vendor:publish --provider="VoyagerInc\BasicAuth\ServiceProvider"
```

Usage
-----

[](#usage)

- We have new middleware with the aliases `basic-auth`

```
return [
    'enabled' => env('BASIC_AUTH_ENABLED', true), // 'true' to enable, 'false' to disable
    'username' => 'admin', // config username
    'password' => 'password', // config password
    'error_message' => 'Unauthorized', // custom error message
    'headers' => [ // config headers
        'WWW-Authenticate' => 'Basic realm="Sample Private Page"',
        'Content-Type' => 'text/plain; charset=utf-8'
    ],
];
```

- Example

```
Route::get('/test', function () {
    return 'basic auth route';
})->middleware(['basic-auth']);
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/88914573f9e40f76c57e972ca786b9d384bd7fd7739381145acdbdb5e537fa72?d=identicon)[silz.it94](/maintainers/silz.it94)

![](https://www.gravatar.com/avatar/22c1d050d1c65dc15bfa55bdb69582bdc32b181e2f3dbe8e7bd5c95d39c74af5?d=identicon)[sonnn@voyager-hcm.com](/maintainers/sonnn@voyager-hcm.com)

---

Top Contributors

[![phutd-voyager](https://avatars.githubusercontent.com/u/167964846?v=4)](https://github.com/phutd-voyager "phutd-voyager (13 commits)")

### Embed Badge

![Health badge](/badges/voyager-inc-basic-auth/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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