PHPackages                             c6digital/laravel-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. c6digital/laravel-basic-auth

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

c6digital/laravel-basic-auth
============================

Add basic authentication to your Laravel project in seconds.

v2.0.0(7mo ago)13311[3 PRs](https://github.com/c6digital/laravel-basic-auth/pulls)MITPHPPHP ^8.2CI passing

Since Jun 14Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/c6digital/laravel-basic-auth)[ Packagist](https://packagist.org/packages/c6digital/laravel-basic-auth)[ Docs](https://github.com/c6digital/laravel-basic-auth)[ GitHub Sponsors]()[ RSS](/packages/c6digital-laravel-basic-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (6)Used By (0)

Add basic authentication to your Laravel project in seconds.
============================================================

[](#add-basic-authentication-to-your-laravel-project-in-seconds)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bc1a62cc77b49e9cc53f3be9c195befbfba63e6c2f42beaa391e226ff34183b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63366469676974616c2f6c61726176656c2d62617369632d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/c6digital/laravel-basic-auth)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3a2c56cc26a7034151a4e3a992cf536d65c3743c67730a73e938687dda376488/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63366469676974616c2f6c61726176656c2d62617369632d617574682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/c6digital/laravel-basic-auth/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5d0000f5ae3e8f5be2a25d9fa86ebd4d3c84e0943454de11681c671619ac0538/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63366469676974616c2f6c61726176656c2d62617369632d617574682f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/c6digital/laravel-basic-auth/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/669f446f8268f59bcaa5c999f1a760abd6abcbd786ea8d414a988ec4bed28f9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63366469676974616c2f6c61726176656c2d62617369632d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/c6digital/laravel-basic-auth)

This package provides a simple `BasicAuth` middleware that adds basic authentication to all routes in your application.

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

[](#installation)

You can install the package via Composer:

```
composer require c6digital/laravel-basic-auth
```

Usage
-----

[](#usage)

The `BasicAuth` middleware is automatically registered after installing the package. Use environment variables to toggle and change credentials.

```
BASIC_AUTH_ENABLED=true
BASIC_AUTH_USERNAME=admin
BASIC_AUTH_PASSWORD=password
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ryan Chandler](https://github.com/c6digital)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~489 days

Total

2

Last Release

213d ago

Major Versions

v1.0.0 → v2.0.02025-10-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/568d485d441c691b0358b9091254a6a671fef8f76b73f28af1180ad568d142b2?d=identicon)[ryangjchandler](/maintainers/ryangjchandler)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (8 commits)")[![c6andy](https://avatars.githubusercontent.com/u/213634680?v=4)](https://github.com/c6andy "c6andy (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravellaravel basic authC6 Digital

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[ryangjchandler/laravel-cloudflare-turnstile

A simple package to help integrate Cloudflare Turnstile.

438896.6k2](/packages/ryangjchandler-laravel-cloudflare-turnstile)[spatie/laravel-passkeys

Use passkeys in your Laravel app

444494.4k16](/packages/spatie-laravel-passkeys)

PHPackages © 2026

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