PHPackages                             vinkla/shield - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. vinkla/shield

Abandoned → [https://github.com/vinkla/laravel-shield#readme](/?search=https%3A%2F%2Fgithub.com%2Fvinkla%2Flaravel-shield%23readme)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

vinkla/shield
=============

A HTTP basic auth middleware for Laravel

9.0.0(3y ago)226376.0k↓56.6%291MITPHPPHP ^8.1

Since Jan 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/vinkla/laravel-shield)[ Packagist](https://packagist.org/packages/vinkla/shield)[ RSS](/packages/vinkla-shield/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (29)Used By (1)

Laravel Shield
==============

[](#laravel-shield)

This package used to be an HTTP basic auth middleware for Laravel. However, it is now deprecated as I no longer use it personally. Laravel already has built-in basic auth support for their web guard.

If you need simpler basic auth for your API, instead of depending on a third-party library, you can add it yourself. Please follow the guide below.

To begin, update your `.env` file with the following details:

```
BASIC_AUTH_USER=your-username
BASIC_AUTH_PASSWORD=your-password
```

Modify your `config/auth.php` file as follows:

```
'basic' => [
    'user' => env('BASIC_AUTH_USER'),
    'password' => env('BASIC_AUTH_PASSWORD'),
],
```

Finally, create a middleware that resembles the code below:

```
